Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -7,11 +7,34 @@ from huggingface_hub import create_repo
|
|
| 7 |
#from gradio import forms
|
| 8 |
import time
|
| 9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
###############################
|
| 11 |
|
| 12 |
import streamlit as st
|
| 13 |
import pyautogui
|
| 14 |
|
|
|
|
|
|
|
|
|
|
| 15 |
st.title("Chat Interface with Screenshot Capability")
|
| 16 |
|
| 17 |
# Create a chat input field
|
|
|
|
| 7 |
#from gradio import forms
|
| 8 |
import time
|
| 9 |
|
| 10 |
+
#########
|
| 11 |
+
import streamlit as st
|
| 12 |
+
|
| 13 |
+
st.title("Drop files onto the chat input field")
|
| 14 |
+
|
| 15 |
+
# Create a chat input field with file upload capabilities
|
| 16 |
+
chat_input = st.chat_input(
|
| 17 |
+
placeholder="Type your message or drop a file...",
|
| 18 |
+
key="chat_input",
|
| 19 |
+
accept_drops=True,
|
| 20 |
+
on_submit=handle_file_drop
|
| 21 |
+
)
|
| 22 |
+
|
| 23 |
+
def handle_file_drop(files):
|
| 24 |
+
# Do something with the dropped files (e.g., process them, store them, etc.)
|
| 25 |
+
print(f"Dropped files: {files}")
|
| 26 |
+
|
| 27 |
+
#if __name__ == "__main__":
|
| 28 |
+
# st.launch(function_name="app")
|
| 29 |
+
#########
|
| 30 |
###############################
|
| 31 |
|
| 32 |
import streamlit as st
|
| 33 |
import pyautogui
|
| 34 |
|
| 35 |
+
import os
|
| 36 |
+
os.environ["DISPLAY"] = ":99.0"
|
| 37 |
+
|
| 38 |
st.title("Chat Interface with Screenshot Capability")
|
| 39 |
|
| 40 |
# Create a chat input field
|