Spaces:
Sleeping
Sleeping
Commit
·
c40b2e1
1
Parent(s):
a401850
Trial Interface
Browse files
app.py
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
import gradio as gr
|
| 3 |
+
import openai
|
| 4 |
+
from dotenv import load_dotenv
|
| 5 |
+
load_dotenv()
|
| 6 |
+
|
| 7 |
+
openai.api_key=os.environ["OPENAI_API_KEY"]
|
| 8 |
+
|
| 9 |
+
import gradio as gr
|
| 10 |
+
|
| 11 |
+
def process_files(files):
|
| 12 |
+
file_names = [f.name for f in files]
|
| 13 |
+
return ",\n".join(file_names)
|
| 14 |
+
|
| 15 |
+
demo = gr.Interface(
|
| 16 |
+
process_files,
|
| 17 |
+
inputs='files',
|
| 18 |
+
outputs="textbox"
|
| 19 |
+
)
|
| 20 |
+
|
| 21 |
+
demo.launch()
|