Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -62,11 +62,11 @@ def ImageGenFromText(text, model):
|
|
62 |
return image
|
63 |
|
64 |
@spaces.GPU
|
65 |
-
def RunLegalModel(
|
66 |
-
|
67 |
if image is not None:
|
68 |
-
|
69 |
-
return
|
70 |
|
71 |
radio1 = gr.Radio(["microsoft/resnet-50", "google/vit-base-patch16-224", "apple/mobilevit-small"], value="microsoft/resnet-50", label="Select a Classifier", info="Image Classifier")
|
72 |
tab1 = gr.Interface(
|
@@ -109,13 +109,13 @@ tab4 = gr.Interface(
|
|
109 |
|
110 |
|
111 |
classifiertypes = ["umarbutler/open-australian-legal-llm"]
|
112 |
-
radio5 = gr.Radio(classifiertypes, value="umarbutler/open-australian-legal-llm", label="Select", info="Legal
|
113 |
textinput5 = gr.Textbox(value="Under the purposes of Part 6 Division 2 of the Act, regulations may confer power on an applicant for")
|
114 |
|
115 |
|
116 |
tab5 = gr.Interface(
|
117 |
fn=RunLegalModel,
|
118 |
-
inputs=[
|
119 |
outputs=["text"],
|
120 |
)
|
121 |
|
|
|
62 |
return image
|
63 |
|
64 |
@spaces.GPU
|
65 |
+
def RunLegalModel(text, model):
|
66 |
+
pettyfogger = pipeline("text-generation", model=model)
|
67 |
if image is not None:
|
68 |
+
shoddyadvice = pettyfogger(text)
|
69 |
+
return shoddyadvice[0]['generated_text']
|
70 |
|
71 |
radio1 = gr.Radio(["microsoft/resnet-50", "google/vit-base-patch16-224", "apple/mobilevit-small"], value="microsoft/resnet-50", label="Select a Classifier", info="Image Classifier")
|
72 |
tab1 = gr.Interface(
|
|
|
109 |
|
110 |
|
111 |
classifiertypes = ["umarbutler/open-australian-legal-llm"]
|
112 |
+
radio5 = gr.Radio(classifiertypes, value="umarbutler/open-australian-legal-llm", label="Select", info="Legal Model")
|
113 |
textinput5 = gr.Textbox(value="Under the purposes of Part 6 Division 2 of the Act, regulations may confer power on an applicant for")
|
114 |
|
115 |
|
116 |
tab5 = gr.Interface(
|
117 |
fn=RunLegalModel,
|
118 |
+
inputs=[textinput5, radio5],
|
119 |
outputs=["text"],
|
120 |
)
|
121 |
|