Spaces:
Sleeping
Sleeping
file upload
Browse files
app.py
CHANGED
@@ -4,6 +4,14 @@ from pprint import pprint
|
|
4 |
|
5 |
def get_response(input_text):
|
6 |
app = RemoteRunnable("https://sop-api-server.onrender.com/speckle_chat/")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
for output in app.stream({"input": input_text}):
|
8 |
for key, value in output.items():
|
9 |
# Node
|
|
|
4 |
|
5 |
def get_response(input_text):
|
6 |
app = RemoteRunnable("https://sop-api-server.onrender.com/speckle_chat/")
|
7 |
+
|
8 |
+
if file:
|
9 |
+
# Implement file handling logic here
|
10 |
+
# For instance, you can extract text from the file to use it as input
|
11 |
+
with open(file.name, 'r') as f:
|
12 |
+
file_content = f.read()
|
13 |
+
input_text += "\nFile content:\n" + file_content
|
14 |
+
|
15 |
for output in app.stream({"input": input_text}):
|
16 |
for key, value in output.items():
|
17 |
# Node
|