Spaces:
Sleeping
Sleeping
json
Browse files
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="
|
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()
|