Tim Seufert commited on
Commit
f86e114
·
1 Parent(s): 72373d0

temporary removed the file upload function

Browse files
Files changed (1) hide show
  1. app.py +0 -12
app.py CHANGED
@@ -50,26 +50,15 @@ def respond(message, image, chat_history):
50
  except Exception as e:
51
  return "", chat_history.append((message, f"Error: {str(e)}"))
52
 
53
- #Upload file function create
54
-
55
- def upload_file(files):
56
- return [file.name for file in files]
57
-
58
  # Create Gradio interface
59
  with gr.Blocks() as demo:
60
  chatbot = gr.Chatbot()
61
  msg = gr.Textbox()
62
  #img = gr.Image(type="filepath")
63
  clear = gr.ClearButton([msg, chatbot])
64
- file_output = gr.File()
65
- upload_button = gr.UploadButton("Click to Upload a File", file_types=["image", "video", "text", ".csv", ".doc"], file_count="multiple")
66
- upload_button.upload(upload_file, upload_button, file_output)
67
-
68
 
69
  # Set up message submission
70
  msg.submit(respond, [msg, chatbot], [msg, chatbot])
71
- upload_button.upload(upload_file, upload_button, file_output)
72
-
73
 
74
  # Launch the demo
75
  demo.launch(
@@ -77,4 +66,3 @@ with gr.Blocks() as demo:
77
  server_name="0.0.0.0",
78
  allowed_paths=["*"]
79
  )
80
-
 
50
  except Exception as e:
51
  return "", chat_history.append((message, f"Error: {str(e)}"))
52
 
 
 
 
 
 
53
  # Create Gradio interface
54
  with gr.Blocks() as demo:
55
  chatbot = gr.Chatbot()
56
  msg = gr.Textbox()
57
  #img = gr.Image(type="filepath")
58
  clear = gr.ClearButton([msg, chatbot])
 
 
 
 
59
 
60
  # Set up message submission
61
  msg.submit(respond, [msg, chatbot], [msg, chatbot])
 
 
62
 
63
  # Launch the demo
64
  demo.launch(
 
66
  server_name="0.0.0.0",
67
  allowed_paths=["*"]
68
  )