debisoft commited on
Commit
cba1f85
·
1 Parent(s): dc31d18
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -119,13 +119,14 @@ Give a score for the product. Format your response as a JSON object with \
119
  print("***total_prompt:")
120
  print(total_prompt)
121
  response = get_completion(total_prompt)
122
- gen_text = response["predictions"][0]["generated_text"]
123
- return json.dumps(extract_json(gen_text, 3))
 
124
  #return json.dumps(response)
125
 
126
  #iface = gr.Interface(fn=greet, inputs="text", outputs="text")
127
  #iface.launch()
128
 
129
  #iface = gr.Interface(fn=greet, inputs=[gr.Textbox(label="Text to find entities", lines=2)], outputs=[gr.HighlightedText(label="Text with entities")], title="NER with dslim/bert-base-NER", description="Find entities using the `dslim/bert-base-NER` model under the hood!", allow_flagging="never", examples=["My name is Andrew and I live in California", "My name is Poli and work at HuggingFace"])
130
- iface = gr.Interface(fn=greet, inputs=[gr.Textbox(label="Elevator pitch", lines=3)], outputs="json")
131
  iface.launch()
 
119
  print("***total_prompt:")
120
  print(total_prompt)
121
  response = get_completion(total_prompt)
122
+ #gen_text = response["predictions"][0]["generated_text"]
123
+ #return json.dumps(extract_json(gen_text, 3))
124
+ return json.dumps(response)
125
  #return json.dumps(response)
126
 
127
  #iface = gr.Interface(fn=greet, inputs="text", outputs="text")
128
  #iface.launch()
129
 
130
  #iface = gr.Interface(fn=greet, inputs=[gr.Textbox(label="Text to find entities", lines=2)], outputs=[gr.HighlightedText(label="Text with entities")], title="NER with dslim/bert-base-NER", description="Find entities using the `dslim/bert-base-NER` model under the hood!", allow_flagging="never", examples=["My name is Andrew and I live in California", "My name is Poli and work at HuggingFace"])
131
+ iface = gr.Interface(fn=greet, inputs=[gr.Textbox(label="Elevator pitch", lines=3)], outputs="text")
132
  iface.launch()