pabloce commited on
Commit
70e4159
·
verified ·
1 Parent(s): 5557964

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -2
app.py CHANGED
@@ -23,6 +23,11 @@ hf_hub_download(
23
  filename="Einstein-v6-7B-Q6_K.gguf",
24
  local_dir="./models"
25
  )
 
 
 
 
 
26
 
27
  css = """
28
  .message-row {
@@ -42,6 +47,13 @@ css = """
42
  }
43
  """
44
 
 
 
 
 
 
 
 
45
 
46
  def get_website_content_from_url(url: str) -> str:
47
  """
@@ -82,7 +94,7 @@ def search_web(search_query: str):
82
  result_string += web_info
83
 
84
  res = result_string.strip()
85
- return "Based on the following results, answer the previous user query:\nResults:\n\n" + res[:32768]
86
 
87
 
88
  def get_messages_formatter_type(model_name):
@@ -215,7 +227,8 @@ demo = gr.ChatInterface(
215
  ),
216
  gr.Dropdown([
217
  'Mistral-7B-Instruct-v0.3-f32.gguf',
218
- 'Einstein-v6-7B-Q6_K.gguf'
 
219
  ],
220
  value="Mistral-7B-Instruct-v0.3-f32.gguf",
221
  label="Model"
 
23
  filename="Einstein-v6-7B-Q6_K.gguf",
24
  local_dir="./models"
25
  )
26
+ hf_hub_download(
27
+ repo_id="crusoeai/dolphin-2.9-llama3-70b-GGUF",
28
+ filename="dolphin-2.9-llama3-70b.Q3_K_M.gguf",
29
+ local_dir="./models"
30
+ )
31
 
32
  css = """
33
  .message-row {
 
47
  }
48
  """
49
 
50
+ def get_context_by_model(model_name):
51
+ model_context_limits = {
52
+ "Mistral-7B-Instruct-v0.3-f32.gguf": 32000,
53
+ "Einstein-v6-7B-Q6_K.gguf": 32000,
54
+ "dolphin-2.9-llama3-70b.Q3_K_M.gguf": 8192
55
+ }
56
+ return model_context_limits.get(model_name, None)
57
 
58
  def get_website_content_from_url(url: str) -> str:
59
  """
 
94
  result_string += web_info
95
 
96
  res = result_string.strip()
97
+ return "Based on the following results, answer the previous user query:\nResults:\n\n" + res[:8000]
98
 
99
 
100
  def get_messages_formatter_type(model_name):
 
227
  ),
228
  gr.Dropdown([
229
  'Mistral-7B-Instruct-v0.3-f32.gguf',
230
+ 'Einstein-v6-7B-Q6_K.gguf',
231
+ 'dolphin-2.9-llama3-70b.Q3_K_M.gguf'
232
  ],
233
  value="Mistral-7B-Instruct-v0.3-f32.gguf",
234
  label="Model"