eogreen commited on
Commit
91fe347
1 Parent(s): 0953097

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -108,12 +108,12 @@ def llm_query(user_input,company):
108
 
109
  # 2 - Create messages
110
  prompt = [
111
- {'role':'system', 'content': qna_system_message},
112
- {'role': 'user', 'content': qna_user_message_template.format(
113
  context=context_for_query,
114
  question=user_input
115
  )
116
- }
117
  ]
118
 
119
  # Get response from the LLM
@@ -155,11 +155,11 @@ def llm_query(user_input,company):
155
 
156
  # Set-up the Gradio UI
157
  textbox = gr.Textbox(label='Question:') # Create a textbox for user input
158
- company = gr.Radio(label='Company:', choices=["aws", "google", "ibm", "meta", "microsoft"], value="aws") # Create a radio button for company selection
159
 
160
  # Create Gradio interface
161
  # For the inputs parameter of Interface provide [textbox,company] with outputs parameter of Interface provide prediction
162
- demo = gr.Interface(fn=llm_query, inputs=[textbox, company], outputs="text", title="Financial Analyst Assistant", description="Ask questions about the financial performance of AWS, Google, IBM, Meta, and Microsoft based on their 10-K reports.\n\nPlease enter a question below.")
163
 
164
  demo.queue()
165
  demo.launch()
 
108
 
109
  # 2 - Create messages
110
  prompt = [
111
+ SystemMessage(content=qna_system_message),
112
+ HumanMessage(content=qna_user_message_template.format(
113
  context=context_for_query,
114
  question=user_input
115
  )
116
+ )
117
  ]
118
 
119
  # Get response from the LLM
 
155
 
156
  # Set-up the Gradio UI
157
  textbox = gr.Textbox(label='Question:') # Create a textbox for user input
158
+ company = gr.Radio(label='Company:', choices=["aws", "google", "IBM", "Meta", "msft"], value="aws") # Create a radio button for company selection
159
 
160
  # Create Gradio interface
161
  # For the inputs parameter of Interface provide [textbox,company] with outputs parameter of Interface provide prediction
162
+ demo = gr.Interface(fn=llm_query, inputs=[textbox, company], outputs="text", title="Financial Analyst Assistant", description="Ask questions about the financial performance of AWS, Google, IBM, Meta, and Microsoft based on their 10-K reports.\n\nPlease enter a question below.", theme=gr.themes.Soft())
163
 
164
  demo.queue()
165
  demo.launch()