jarguello76 commited on
Commit
48dd983
·
verified ·
1 Parent(s): 2b6c64b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -10
app.py CHANGED
@@ -83,15 +83,7 @@ math_tool = FunctionTool.from_defaults(
83
  TOOLS = [validate_tool, search_tool, math_tool]
84
 
85
  from llama_index.core.agent import ReActAgent
86
- # from llama_index.llms.huggingface_api import HuggingFaceInferenceAPI
87
 
88
- # llm = HuggingFaceInferenceAPI(
89
- # model_name="mistralai/Mistral-7B-Instruct-v0.3",
90
- # token=HF_TOKEN,
91
- # context_window=3900,
92
- # max_new_tokens=256,
93
- # generate_kwargs={"temperature": 0.7}
94
- # )
95
 
96
  from llama_index.llms.huggingface import HuggingFaceLLM
97
 
@@ -139,7 +131,7 @@ iface_loop = gr.Interface(
139
  description="Loops until the guessed question has a similarity score > 0.6."
140
  )
141
 
142
- # --- Additional ChatInterface Template ---
143
  client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
144
 
145
  def respond(
@@ -175,7 +167,7 @@ def respond(
175
  demo = gr.ChatInterface(
176
  respond,
177
  additional_inputs=[
178
- gr.Textbox(value="You are a friendly Chatbot.", label="System message"),
179
  gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
180
  gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
181
  gr.Slider(minimum=0.1, maximum=1.0, value=0.95, step=0.05, label="Top-p (nucleus sampling)"),
 
83
  TOOLS = [validate_tool, search_tool, math_tool]
84
 
85
  from llama_index.core.agent import ReActAgent
 
86
 
 
 
 
 
 
 
 
87
 
88
  from llama_index.llms.huggingface import HuggingFaceLLM
89
 
 
131
  description="Loops until the guessed question has a similarity score > 0.6."
132
  )
133
 
134
+
135
  client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
136
 
137
  def respond(
 
167
  demo = gr.ChatInterface(
168
  respond,
169
  additional_inputs=[
170
+ gr.Textbox(value="You are a Chatbot.", label="System message"),
171
  gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
172
  gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
173
  gr.Slider(minimum=0.1, maximum=1.0, value=0.95, step=0.05, label="Top-p (nucleus sampling)"),