yfor commited on
Commit
3b4d54a
Β·
1 Parent(s): 746e30b

update docs

Browse files
Files changed (2) hide show
  1. app.py +5 -8
  2. 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='openai api',
 
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: