Moha782 commited on
Commit
89c0d58
·
verified ·
1 Parent(s): f53c23c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -6
app.py CHANGED
@@ -6,7 +6,7 @@ For more information on `huggingface_hub` Inference API support, please check th
6
  """
7
  client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
8
 
9
- initial_message = "Hello! I'm the Apex Customs car configuration assistant. Welcome to Apex Customs, where we specialize in modifying and customizing some of the most popular sports cars and performance vehicles on the market. Our team of experts can help you take your ride to the next level with a wide range of customization options.\n\nBased on your interest in high-performance vehicles, I'd like to suggest some popular car models that we work with. If you're looking for a sleek and powerful sports car, the Toyota Supra or Nissan GT-R might be a great fit for you. For those who prefer a more classic rally car, the Mitsubishi Lancer Evolution or Subaru WRX STI might be more your style. And if you're a fan of the Honda Civic Type R, we've got you covered there too.\n\nWhen it comes to customization options, we offer everything from exterior modifications like body kits and spoilers to interior upgrades like seats and steering wheels. We can also help you enhance your car's performance with engine tuning, exhaust systems, and suspension upgrades. And if you're looking to upgrade your audio and entertainment system, we've got you covered there too.\n\nAs for paint colors, we offer a wide range of options to choose from. Some popular choices include matte black, Nardo gray, midnight purple, riviera blue, and fluorescent green.\n\nLet us know which car model you're interested in, and we can provide more detailed information about the customization options available for that specific vehicle. Thanks for considering Apex Customs for your next car modification project!\n\nHow can I help you today?"
10
 
11
  def respond(
12
  message,
@@ -38,10 +38,7 @@ def respond(
38
  token = message.choices[0].delta.content
39
 
40
  response += token
41
- yield response, history # Yield the response and the current history
42
-
43
- # Update the history with the new message and response
44
- history.append((message, response))
45
 
46
  """
47
  For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
@@ -51,7 +48,7 @@ system_message = "You are a helpful car configuration assistant, specifically yo
51
 
52
  demo = gr.ChatInterface(
53
  fn=respond,
54
- #chatbot=gr.Chatbot(value=[[None, initial_message]]),
55
  additional_inputs=[
56
  gr.Textbox(value=system_message, label="System message"),
57
  gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
 
6
  """
7
  client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
8
 
9
+ initial_message = "Hello! I'm the Apex Customs car configuration assistant. Welcome to Apex Customs, where we specialize in modifying and customizing some of the most popular sports cars and performance vehicles on the market. Our team of experts can help you take your ride to the next level with a wide range of customization options.\nBased on your interest in high-performance vehicles, I'd like to suggest some popular car models that we work with. If you're looking for a sleek and powerful sports car, the Toyota Supra or Nissan GT-R might be a great fit for you. For those who prefer a more classic rally car, the Mitsubishi Lancer Evolution or Subaru WRX STI might be more your style. And if you're a fan of the Honda Civic Type R, we've got you covered there too.\nWhen it comes to customization options, we offer everything from exterior modifications like body kits and spoilers to interior upgrades like seats and steering wheels. We can also help you enhance your car's performance with engine tuning, exhaust systems, and suspension upgrades. And if you're looking to upgrade your audio and entertainment system, we've got you covered there too.\nAs for paint colors, we offer a wide range of options to choose from. Some popular choices include matte black, Nardo gray, midnight purple, riviera blue, and fluorescent green.\nLet us know which car model you're interested in, and we can provide more detailed information about the customization options available for that specific vehicle. Thanks for considering Apex Customs for your next car modification project!\nHow can I help you today?"
10
 
11
  def respond(
12
  message,
 
38
  token = message.choices[0].delta.content
39
 
40
  response += token
41
+ yield response
 
 
 
42
 
43
  """
44
  For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
 
48
 
49
  demo = gr.ChatInterface(
50
  fn=respond,
51
+ chatbot=gr.Chatbot(value=[[None, initial_message]]),
52
  additional_inputs=[
53
  gr.Textbox(value=system_message, label="System message"),
54
  gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),