Abrahamau commited on
Commit
b1c01e9
·
verified ·
1 Parent(s): 367b09f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -62,11 +62,11 @@ def ImageGenFromText(text, model):
62
  return image
63
 
64
  @spaces.GPU
65
- def RunLegalModel(model, text):
66
- imgclassifier = pettyfogger("ext-generation", model=model)
67
  if image is not None:
68
- description = pettyfogger(text)
69
- return description[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,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 Question")
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=[radio5, textinput5],
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