Spaces:
Sleeping
Sleeping
syedMohib44
commited on
Commit
·
286c8c5
1
Parent(s):
bee40cd
app.py
CHANGED
@@ -85,7 +85,7 @@ def gradio_upload(file):
|
|
85 |
return "No file selected."
|
86 |
|
87 |
try:
|
88 |
-
content = file
|
89 |
import requests
|
90 |
|
91 |
base_url = os.getenv("HF_SPACE_URL", "http://localhost:7860")
|
@@ -98,6 +98,7 @@ def gradio_upload(file):
|
|
98 |
except Exception as e:
|
99 |
return f"❌ Error: {str(e)}"
|
100 |
|
|
|
101 |
gr_app = gr.Interface(
|
102 |
fn=gradio_upload,
|
103 |
inputs=gr.File(label="Upload .txt or .json file"),
|
|
|
85 |
return "No file selected."
|
86 |
|
87 |
try:
|
88 |
+
content = str(file) # Works for NamedString
|
89 |
import requests
|
90 |
|
91 |
base_url = os.getenv("HF_SPACE_URL", "http://localhost:7860")
|
|
|
98 |
except Exception as e:
|
99 |
return f"❌ Error: {str(e)}"
|
100 |
|
101 |
+
|
102 |
gr_app = gr.Interface(
|
103 |
fn=gradio_upload,
|
104 |
inputs=gr.File(label="Upload .txt or .json file"),
|