jozzy commited on
Commit
bc4d3e7
1 Parent(s): ef0dd6a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -131,17 +131,17 @@ def talk2file(index_name, text):
131
  # if msg['role'] != 'system':
132
  # chats += msg['role'] + ": " + msg['content'] + "\n\n"
133
 
134
- Title1 = '<h2 style="background-color: yellow;"><b>User Question: </b></h2>'
135
- User_Question = f'<div style="background-color: yellow; display: inline-block; word-wrap: break-word;">{prompt}</div>'
136
  Title2 = '<h2 style="background-color: #ADD8E6;"><b>Context Found: </b></h2>'
137
  context = markdown2.markdown(docs[0].page_content)
138
  #context = f'<span style="background-color: #ADD8E6; display: inline-block; word-wrap: break-word;">{context2html}</span>'
139
- Title3 = '<h2 style="background-color: #90EE90;"><b>Ansewr: </b></h2>'
140
- answer = f'<div style="background-color: #90EE90; display: inline-block; overflow-wrap: break-word; word-break: break-all;">{system_message["content"]}</div>'
141
 
142
 
143
 
144
- return Title1 + User_Question + Title2 + context + Title3 + answer
145
 
146
 
147
 
@@ -207,7 +207,7 @@ with gr.Blocks() as pinecone_tools:
207
 
208
  textbox = gr.inputs.Textbox(label="Vector Server Index Name: ", default="amd")
209
  role = gr.Interface(fn=roleChoice, inputs="text", outputs="text", description = "Choose your GPT roles, e.g. You are a helpful technology assistant.")
210
- text = gr.Interface(fn=talk2file, inputs=[textbox, "text"], outputs="html")
211
 
212
  vector_server = gr.Interface(fn=process_file, inputs=["text", gr.inputs.File(file_count="directory")], outputs="text")
213
 
 
131
  # if msg['role'] != 'system':
132
  # chats += msg['role'] + ": " + msg['content'] + "\n\n"
133
 
134
+ #Title1 = '<h2 style="background-color: yellow;"><b>User Question: </b></h2>'
135
+ #User_Question = f'<div style="background-color: yellow; display: inline-block; word-wrap: break-word;">{prompt}</div>'
136
  Title2 = '<h2 style="background-color: #ADD8E6;"><b>Context Found: </b></h2>'
137
  context = markdown2.markdown(docs[0].page_content)
138
  #context = f'<span style="background-color: #ADD8E6; display: inline-block; word-wrap: break-word;">{context2html}</span>'
139
+ #Title3 = '<h2 style="background-color: #90EE90;"><b>Ansewr: </b></h2>'
140
+ answer = system_message["content"]
141
 
142
 
143
 
144
+ return [Title2 + context, "Answer:\n" + answer]
145
 
146
 
147
 
 
207
 
208
  textbox = gr.inputs.Textbox(label="Vector Server Index Name: ", default="amd")
209
  role = gr.Interface(fn=roleChoice, inputs="text", outputs="text", description = "Choose your GPT roles, e.g. You are a helpful technology assistant.")
210
+ text = gr.Interface(fn=talk2file, inputs=[textbox, "text"], outputs=["html", "text"])
211
 
212
  vector_server = gr.Interface(fn=process_file, inputs=["text", gr.inputs.File(file_count="directory")], outputs="text")
213