app.py
CHANGED
|
@@ -1,11 +1,21 @@
|
|
|
|
|
|
|
|
| 1 |
import gradio as gr
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
def greet(input):
|
|
|
|
|
|
|
|
|
|
| 4 |
return "Hello " + input + "!!"
|
| 5 |
|
| 6 |
#iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
| 7 |
#iface.launch()
|
| 8 |
|
| 9 |
#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"])
|
| 10 |
-
iface = gr.Interface(fn=greet, inputs=[gr.Textbox(label="
|
| 11 |
iface.launch()
|
|
|
|
| 1 |
+
import openai
|
| 2 |
+
import os
|
| 3 |
import gradio as gr
|
| 4 |
+
from dotenv import load_dotenv, find_dotenv
|
| 5 |
+
_ = load_dotenv(find_dotenv())
|
| 6 |
+
|
| 7 |
+
|
| 8 |
+
openai.api_key = os.getenv('OPENAI_API_KEY')
|
| 9 |
|
| 10 |
def greet(input):
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
|
| 14 |
return "Hello " + input + "!!"
|
| 15 |
|
| 16 |
#iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
| 17 |
#iface.launch()
|
| 18 |
|
| 19 |
#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"])
|
| 20 |
+
iface = gr.Interface(fn=greet, inputs=[gr.Textbox(label="Elevator pitch", lines=3)], outputs="text")
|
| 21 |
iface.launch()
|