Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -41,8 +41,8 @@ def respond(
|
|
41 |
llm = Llama(
|
42 |
model_path=f"models/{model}",
|
43 |
n_gpu_layers=0,
|
44 |
-
n_batch=
|
45 |
-
n_ctx=
|
46 |
)
|
47 |
llm_model = model
|
48 |
|
@@ -107,20 +107,43 @@ demo = gr.ChatInterface(
|
|
107 |
value="llama-3.2-1b-instruct-q4_k_m.gguf",
|
108 |
label="Model"
|
109 |
),
|
110 |
-
gr.Textbox(value="You are
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
111 |
gr.Slider(minimum=1, maximum=2048, value=1024, step=1, label="Max tokens"),
|
112 |
gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
|
113 |
gr.Slider(
|
114 |
minimum=0.1,
|
115 |
-
maximum=
|
116 |
-
value=0.
|
117 |
step=0.05,
|
118 |
label="Top-p",
|
119 |
),
|
120 |
gr.Slider(
|
121 |
minimum=0,
|
122 |
maximum=100,
|
123 |
-
value=
|
124 |
step=1,
|
125 |
label="Top-k",
|
126 |
),
|
@@ -152,9 +175,21 @@ demo = gr.ChatInterface(
|
|
152 |
likeable=True,
|
153 |
show_copy_button=True
|
154 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
155 |
cache_examples=False,
|
156 |
autofocus=False,
|
157 |
-
concurrency_limit=
|
158 |
)
|
159 |
|
160 |
if __name__ == "__main__":
|
|
|
41 |
llm = Llama(
|
42 |
model_path=f"models/{model}",
|
43 |
n_gpu_layers=0,
|
44 |
+
n_batch=64000,
|
45 |
+
n_ctx=1024,
|
46 |
)
|
47 |
llm_model = model
|
48 |
|
|
|
107 |
value="llama-3.2-1b-instruct-q4_k_m.gguf",
|
108 |
label="Model"
|
109 |
),
|
110 |
+
gr.Textbox(value="""You are Meta Llama 3.2 (1B), an advanced AI assistant created by Meta. Your capabilities include:
|
111 |
+
|
112 |
+
1. Complex reasoning and problem-solving
|
113 |
+
2. Multilingual understanding and generation
|
114 |
+
3. Creative and analytical writing
|
115 |
+
4. Code understanding and generation
|
116 |
+
5. Task decomposition and step-by-step guidance
|
117 |
+
6. Summarization and information extraction
|
118 |
+
|
119 |
+
Always strive for accuracy, clarity, and helpfulness in your responses. If you're unsure about something, express your uncertainty. Use the following format for your responses:
|
120 |
+
|
121 |
+
<thinking>
|
122 |
+
[Your reasoning process here]
|
123 |
+
</thinking>
|
124 |
+
|
125 |
+
<output>
|
126 |
+
[Your final response here]
|
127 |
+
</output>
|
128 |
+
|
129 |
+
If you need to correct yourself:
|
130 |
+
|
131 |
+
<reflection>
|
132 |
+
[Your correction and updated thoughts here]
|
133 |
+
</reflection>""", label="System message"),
|
134 |
gr.Slider(minimum=1, maximum=2048, value=1024, step=1, label="Max tokens"),
|
135 |
gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
|
136 |
gr.Slider(
|
137 |
minimum=0.1,
|
138 |
+
maximum=2.0,
|
139 |
+
value=0.1,
|
140 |
step=0.05,
|
141 |
label="Top-p",
|
142 |
),
|
143 |
gr.Slider(
|
144 |
minimum=0,
|
145 |
maximum=100,
|
146 |
+
value=20,
|
147 |
step=1,
|
148 |
label="Top-k",
|
149 |
),
|
|
|
175 |
likeable=True,
|
176 |
show_copy_button=True
|
177 |
),
|
178 |
+
examples=[
|
179 |
+
["Hello! Can you introduce yourself?"],
|
180 |
+
["What's the capital of France?"],
|
181 |
+
["Can you explain the concept of photosynthesis?"],
|
182 |
+
["Write a short story about a robot learning to paint."],
|
183 |
+
["Explain the difference between machine learning and deep learning."],
|
184 |
+
["Can you help me debug this Python code?\n\ndef fibonacci(n):\n if n <= 0:\n return []\n elif n == 1:\n return [0]\n elif n == 2:\n return [0, 1]\n else:\n fib = [0, 1]\n for i in range(2, n):\n fib.append(fib[i-1] + fib[i-2])\n return fib\n\nprint(fibonacci(5))"],
|
185 |
+
["Summarize the key points of climate change and its global impact."],
|
186 |
+
["Translate this sentence to French, Spanish, and German: 'The quick brown fox jumps over the lazy dog.'"],
|
187 |
+
["Explain quantum computing to a 10-year-old."],
|
188 |
+
["Design a step-by-step meal plan for someone trying to lose weight and build muscle."]
|
189 |
+
],
|
190 |
cache_examples=False,
|
191 |
autofocus=False,
|
192 |
+
concurrency_limit=None
|
193 |
)
|
194 |
|
195 |
if __name__ == "__main__":
|