Spaces:
Runtime error
Runtime error
update docs
Browse files- app.py +5 -8
- gpt_analyze.py +1 -1
app.py
CHANGED
|
@@ -1,16 +1,13 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
from gpt_analyze import analyze_by_3p5
|
| 3 |
|
| 4 |
-
|
| 5 |
-
def greet(context, api_key):
|
| 6 |
-
return analyze_by_3p5(context, api_key)
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
iface = gr.Interface(fn=greet, inputs=[
|
| 10 |
gr.components.Textbox(label='Your text',
|
| 11 |
lines=5,
|
|
|
|
| 12 |
max_lines=100),
|
| 13 |
-
gr.components.Textbox(label='
|
|
|
|
| 14 |
type="password")
|
| 15 |
], outputs="text")
|
| 16 |
-
iface.launch()
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
from gpt_analyze import analyze_by_3p5
|
| 3 |
|
| 4 |
+
iface = gr.Interface(fn=analyze_by_3p5, inputs=[
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
gr.components.Textbox(label='Your text',
|
| 6 |
lines=5,
|
| 7 |
+
placeholder='Long text need to be short',
|
| 8 |
max_lines=100),
|
| 9 |
+
gr.components.Textbox(label='api key',
|
| 10 |
+
placeholder='apikey from openai',
|
| 11 |
type="password")
|
| 12 |
], outputs="text")
|
| 13 |
+
iface.launch(share=True)
|
gpt_analyze.py
CHANGED
|
@@ -14,7 +14,7 @@ def analyze_by_3p5(text, api_key=None):
|
|
| 14 |
"""
|
| 15 |
δ½Ώη¨ GPT-3.5 樑εεζζ»η»ζζ¬
|
| 16 |
:param text: ζζ¬
|
| 17 |
-
param api_key: apikey from openai
|
| 18 |
:return: εζη»ζ
|
| 19 |
"""
|
| 20 |
try:
|
|
|
|
| 14 |
"""
|
| 15 |
δ½Ώη¨ GPT-3.5 樑εεζζ»η»ζζ¬
|
| 16 |
:param text: ζζ¬
|
| 17 |
+
:param api_key: apikey from openai
|
| 18 |
:return: εζη»ζ
|
| 19 |
"""
|
| 20 |
try:
|