yfor commited on
Commit
5ad9b5e
·
1 Parent(s): 39d734f

init app.py

Browse files
Files changed (2) hide show
  1. app.py +16 -0
  2. requirements.txt +5 -0
app.py ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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(share=True)
requirements.txt ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ openai==0.27.7
2
+ langchain==0.0.166
3
+ fastapi==0.96.0
4
+ uvicorn==0.22.0
5
+ gradio==3.34.0