arjunanand13 commited on
Commit
54c28b8
1 Parent(s): ecb6fb4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -3
app.py CHANGED
@@ -1,4 +1,5 @@
1
  import torch
 
2
  from torch import cuda, bfloat16
3
  from transformers import AutoTokenizer, AutoModelForCausalLM, pipeline, BitsAndBytesConfig, StoppingCriteria, StoppingCriteriaList
4
  from langchain.llms import HuggingFacePipeline
@@ -117,9 +118,15 @@ class Chatbot:
117
  "I'm using Code Composer Studio 5.4.0.00091 and enabled FPv4SPD16 floating point support for CortexM4 in TDA2. However, after building the project, the .asm file shows --float_support=vfplib instead of FPv4SPD16. Why is this happening?",
118
  "Master core in TDA2XX is a15 and in TDA3XX it is m4,so we have to shift all modules that are being used by a15 in TDA2XX to m4 in TDA3xx."]
119
 
120
- dropdown = gr.Dropdown(label="Sample queries", choices=EXAMPLES)
121
-
122
 
 
 
 
 
 
 
 
 
123
 
124
  tab1 = gr.Interface(fn=self.qa_infer, inputs=[gr.Textbox(label="QUERY", placeholder ="Enter your query here")], allow_flagging='never', examples=EXAMPLES, cache_examples=False, outputs=[gr.Textbox(label="SOLUTION"), gr.Textbox(label="RELATED QUERIES"), gr.HTML()], css=css_code)
125
  tab2 = gr.Interface(fn=self.qa_infer, inputs=[dropdown], allow_flagging='never', outputs=[gr.Textbox(label="SOLUTION"), gr.Textbox(label="RELATED QUERIES"), gr.HTML()], css=css_code, title="Dropdown Input")
@@ -129,7 +136,7 @@ class Chatbot:
129
  # tab1.outputs = dummy_outputs
130
  # tab2.outputs = dummy_outputs
131
 
132
- gr.TabbedInterface([tab1, tab2],["Textbox Input", "Dropdown Input"],title="TI E2E FORUM",theme="compact").launch(debug=True)
133
 
134
  # Instantiate and launch the chatbot
135
  chatbot = Chatbot()
 
1
  import torch
2
+ import json
3
  from torch import cuda, bfloat16
4
  from transformers import AutoTokenizer, AutoModelForCausalLM, pipeline, BitsAndBytesConfig, StoppingCriteria, StoppingCriteriaList
5
  from langchain.llms import HuggingFacePipeline
 
118
  "I'm using Code Composer Studio 5.4.0.00091 and enabled FPv4SPD16 floating point support for CortexM4 in TDA2. However, after building the project, the .asm file shows --float_support=vfplib instead of FPv4SPD16. Why is this happening?",
119
  "Master core in TDA2XX is a15 and in TDA3XX it is m4,so we have to shift all modules that are being used by a15 in TDA2XX to m4 in TDA3xx."]
120
 
 
 
121
 
122
+
123
+ file_path = "ticketNames.txt"
124
+
125
+ # Read the file content
126
+ with open(file_path, "r") as file:
127
+ content = file.read()
128
+ ticket_names = json.loads(content)
129
+ dropdown = gr.Dropdown(label="Sample queries", choices=ticket_names)
130
 
131
  tab1 = gr.Interface(fn=self.qa_infer, inputs=[gr.Textbox(label="QUERY", placeholder ="Enter your query here")], allow_flagging='never', examples=EXAMPLES, cache_examples=False, outputs=[gr.Textbox(label="SOLUTION"), gr.Textbox(label="RELATED QUERIES"), gr.HTML()], css=css_code)
132
  tab2 = gr.Interface(fn=self.qa_infer, inputs=[dropdown], allow_flagging='never', outputs=[gr.Textbox(label="SOLUTION"), gr.Textbox(label="RELATED QUERIES"), gr.HTML()], css=css_code, title="Dropdown Input")
 
136
  # tab1.outputs = dummy_outputs
137
  # tab2.outputs = dummy_outputs
138
 
139
+ gr.TabbedInterface([tab1, tab2],["Textbox Input", "Dropdown Input"],title="TI E2E FORUM",css=css_code).launch(debug=True)
140
 
141
  # Instantiate and launch the chatbot
142
  chatbot = Chatbot()