pflooky commited on
Commit
1ef58cb
β€’
1 Parent(s): 6df72ab

Update sdk version in README to 4.15.0

Browse files
Files changed (2) hide show
  1. README.md +2 -2
  2. app.py +9 -1
README.md CHANGED
@@ -1,10 +1,10 @@
1
  ---
2
  title: Document Answering
3
- emoji: πŸ”₯
4
  colorFrom: gray
5
  colorTo: purple
6
  sdk: gradio
7
- sdk_version: 3.1.7
8
  app_file: app.py
9
  pinned: false
10
  license: apache-2.0
 
1
  ---
2
  title: Document Answering
3
+ emoji: πŸ‘€
4
  colorFrom: gray
5
  colorTo: purple
6
  sdk: gradio
7
+ sdk_version: 4.15.0
8
  app_file: app.py
9
  pinned: false
10
  license: apache-2.0
app.py CHANGED
@@ -14,7 +14,7 @@ uploaded_df = gr.Dataframe(headers=["file_name", "content_length"])
14
  upload_files_section = gr.Files(
15
  file_types=[".md", ".mdx", ".rst", ".txt"],
16
  )
17
- chatbot_stream = gr.Chatbot(bubble_full_width=False, show_copy_button=True, likeable=True)
18
 
19
 
20
  def load_docs(files):
@@ -100,6 +100,13 @@ def predict(message, history):
100
  # return format_answer
101
 
102
 
 
 
 
 
 
 
 
103
  vector_db = get_vector_db()
104
  llm_model = get_llm_model(vector_db)
105
 
@@ -124,6 +131,7 @@ with gr.Blocks() as blocks:
124
  )
125
  # upload_files_section.upload(load_docs, inputs=upload_files_section)
126
  with gr.Column(scale=4, min_width=600) as chat_col:
 
127
  chat_interface_stream.render()
128
 
129
  blocks.queue().launch()
 
14
  upload_files_section = gr.Files(
15
  file_types=[".md", ".mdx", ".rst", ".txt"],
16
  )
17
+ chatbot_stream = gr.Chatbot(bubble_full_width=False, show_copy_button=True)
18
 
19
 
20
  def load_docs(files):
 
100
  # return format_answer
101
 
102
 
103
+ def vote(data: gr.LikeData):
104
+ if data.liked:
105
+ gr.Info("You upvoted this response 😊", )
106
+ else:
107
+ gr.Warning("You downvoted this response πŸ‘€")
108
+
109
+
110
  vector_db = get_vector_db()
111
  llm_model = get_llm_model(vector_db)
112
 
 
131
  )
132
  # upload_files_section.upload(load_docs, inputs=upload_files_section)
133
  with gr.Column(scale=4, min_width=600) as chat_col:
134
+ chatbot_stream.like(vote, None, None)
135
  chat_interface_stream.render()
136
 
137
  blocks.queue().launch()