MiladMola commited on
Commit
08ba387
1 Parent(s): 68cf99c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +28 -12
app.py CHANGED
@@ -11,12 +11,24 @@ from huggingface_hub import hf_hub_download
11
 
12
  hf_hub_download(
13
  repo_id="PartAI/Dorna-Llama3-8B-Instruct-GGUF",
14
- filename="dorna-llama3-8b-instruct.Q2_K.gguf",
15
  local_dir = "."
16
  )
17
  hf_hub_download(
18
  repo_id="PartAI/Dorna-Llama3-8B-Instruct-GGUF",
19
- filename="dorna-llama3-8b-instruct.Q4_0.gguf",
 
 
 
 
 
 
 
 
 
 
 
 
20
  local_dir = "."
21
  )
22
 
@@ -96,7 +108,7 @@ def respond(
96
  messages.add_message(assistant)
97
 
98
  stream = agent.get_chat_response(
99
- message,
100
  llm_sampling_settings=settings,
101
  chat_history=messages,
102
  returns_streaming_generator=True,
@@ -120,7 +132,17 @@ PLACEHOLDER = """
120
  demo = gr.ChatInterface(
121
  respond,
122
  additional_inputs=[
123
- gr.Textbox(value="You are a helpful assistant.", label="System message"),
 
 
 
 
 
 
 
 
 
 
124
  gr.Slider(minimum=1, maximum=8192, value=2048, step=1, label="Max tokens"),
125
  gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
126
  gr.Slider(
@@ -144,13 +166,7 @@ demo = gr.ChatInterface(
144
  step=0.1,
145
  label="Repetition penalty",
146
  ),
147
- gr.Dropdown([
148
- 'dorna-llama3-8b-instruct.Q2_K.gguf',
149
- 'dorna-llama3-8b-instruct.Q4_0.gguf',
150
- ],
151
- value="dorna-llama3-8b-instruct.Q2_K.gguf",
152
- label="Model"
153
- ),
154
  ],
155
  theme=gr.themes.Soft(primary_hue="violet", secondary_hue="violet", neutral_hue="gray",font=[gr.themes.GoogleFont("Exo"), "ui-sans-serif", "system-ui", "sans-serif"]).set(
156
  body_background_fill_dark="#16141c",
@@ -168,7 +184,7 @@ demo = gr.ChatInterface(
168
  undo_btn="Undo",
169
  clear_btn="Clear",
170
  submit_btn="Send",
171
- description="Chat with Dorna-Llama3 8B (2-bit GGUF)",
172
  chatbot=gr.Chatbot(scale=1, placeholder=PLACEHOLDER)
173
  )
174
 
 
11
 
12
  hf_hub_download(
13
  repo_id="PartAI/Dorna-Llama3-8B-Instruct-GGUF",
14
+ filename="dorna-llama3-8b-instruct.Q4_0.gguf",
15
  local_dir = "."
16
  )
17
  hf_hub_download(
18
  repo_id="PartAI/Dorna-Llama3-8B-Instruct-GGUF",
19
+ filename="dorna-llama3-8b-instruct.Q8_0.gguf",
20
+ local_dir = "."
21
+ )
22
+
23
+ hf_hub_download(
24
+ repo_id="PartAI/Dorna-Llama3-8B-Instruct-GGUF",
25
+ filename="dorna-llama3-8b-instruct.Q5_0.gguf",
26
+ local_dir = "."
27
+ )
28
+
29
+ hf_hub_download(
30
+ repo_id="PartAI/Dorna-Llama3-8B-Instruct-GGUF",
31
+ filename="dorna-llama3-8b-instruct.bf16.gguf",
32
  local_dir = "."
33
  )
34
 
 
108
  messages.add_message(assistant)
109
 
110
  stream = agent.get_chat_response(
111
+ message[-2:],
112
  llm_sampling_settings=settings,
113
  chat_history=messages,
114
  returns_streaming_generator=True,
 
132
  demo = gr.ChatInterface(
133
  respond,
134
  additional_inputs=[
135
+ gr.Textbox(value="You are a helpful Persian assistant. Please answer questions in the asked language.", label="System message"),
136
+ gr.Dropdown([
137
+ 'dorna-llama3-8b-instruct.Q8_0.gguf',
138
+ 'dorna-llama3-8b-instruct.Q4_0.gguf',
139
+ 'dorna-llama3-8b-instruct.Q5_0.gguf',
140
+ 'dorna-llama3-8b-instruct.bf16.gguf',
141
+
142
+ ],
143
+ value="dorna-llama3-8b-instruct.Q8_0.gguf",
144
+ label="Model"
145
+ ),
146
  gr.Slider(minimum=1, maximum=8192, value=2048, step=1, label="Max tokens"),
147
  gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
148
  gr.Slider(
 
166
  step=0.1,
167
  label="Repetition penalty",
168
  ),
169
+
 
 
 
 
 
 
170
  ],
171
  theme=gr.themes.Soft(primary_hue="violet", secondary_hue="violet", neutral_hue="gray",font=[gr.themes.GoogleFont("Exo"), "ui-sans-serif", "system-ui", "sans-serif"]).set(
172
  body_background_fill_dark="#16141c",
 
184
  undo_btn="Undo",
185
  clear_btn="Clear",
186
  submit_btn="Send",
187
+ description="Chat with Dorna-Llama3 8B GGUF",
188
  chatbot=gr.Chatbot(scale=1, placeholder=PLACEHOLDER)
189
  )
190