ECUiVADE commited on
Commit
a9313e4
1 Parent(s): 9adf13f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -5
app.py CHANGED
@@ -60,8 +60,12 @@ Age=""
60
  chat_log_name =""
61
 
62
  from llama_cpp import Llama
63
- llm = Llama(model_path=model_file, model_type="mistral",n_gpu_layers=-1,n_ctx = 2048)
64
 
 
 
 
 
 
65
 
66
  def reset_chat():
67
  global chat_history, chat_log_history, isFirstRun, context, chat_log_name
@@ -235,7 +239,6 @@ chat_bot=gr.ChatInterface(
235
  title="""AI Chat Bot - ECU IVADE"""
236
  )
237
 
238
-
239
  name_interface = gr.Interface(
240
  fn=name_interface,
241
  inputs=[
@@ -244,7 +247,6 @@ name_interface = gr.Interface(
244
  gr.Textbox(label="Ethnicity", placeholder="Enter your Ethnicity here..."),
245
  gr.Dropdown(choices=["Male", "Female", "Other"], label="Gender"),
246
  gr.Textbox(label="Age", placeholder="Enter your Age here..."),
247
- gr.Button.click(fn=print_something)
248
  ],outputs="text",
249
  title="ECU-IVADE : User Information",
250
  description="Please enter your name and occupation."
@@ -252,9 +254,9 @@ name_interface = gr.Interface(
252
 
253
 
254
  with gr.Blocks() as demo:
255
- gr.Markdown("Start typing below and then click **Run** to see the output.")
256
  with gr.Row():
257
- out = gr.Textbox()
258
  btn = gr.Button("Reset ChatBot Instance")
259
  btn.click(fn=reset_all, inputs=None, outputs=out)
260
 
 
60
  chat_log_name =""
61
 
62
  from llama_cpp import Llama
 
63
 
64
+ def load_model():
65
+ llm = Llama(model_path=model_file, model_type="mistral",n_gpu_layers=-1,n_ctx = 2048)
66
+ return "Model loaded"
67
+
68
+ load_model()
69
 
70
  def reset_chat():
71
  global chat_history, chat_log_history, isFirstRun, context, chat_log_name
 
239
  title="""AI Chat Bot - ECU IVADE"""
240
  )
241
 
 
242
  name_interface = gr.Interface(
243
  fn=name_interface,
244
  inputs=[
 
247
  gr.Textbox(label="Ethnicity", placeholder="Enter your Ethnicity here..."),
248
  gr.Dropdown(choices=["Male", "Female", "Other"], label="Gender"),
249
  gr.Textbox(label="Age", placeholder="Enter your Age here..."),
 
250
  ],outputs="text",
251
  title="ECU-IVADE : User Information",
252
  description="Please enter your name and occupation."
 
254
 
255
 
256
  with gr.Blocks() as demo:
257
+ gr.Markdown("Press the button below to restart the chat Interface.")
258
  with gr.Row():
259
+ out = gr.Textbox(label="Output")
260
  btn = gr.Button("Reset ChatBot Instance")
261
  btn.click(fn=reset_all, inputs=None, outputs=out)
262