Spaces:
Build error
Build error
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,7 +107,7 @@ demo = gr.ChatInterface(
|
|
| 107 |
value="llama-3.2-1b-instruct-q4_k_m.gguf",
|
| 108 |
label="Model"
|
| 109 |
),
|
| 110 |
-
gr.
|
| 111 |
|
| 112 |
1. Complex reasoning and problem-solving
|
| 113 |
2. Multilingual understanding and generation
|
|
@@ -117,33 +117,20 @@ demo = gr.ChatInterface(
|
|
| 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.
|
| 140 |
step=0.05,
|
| 141 |
label="Top-p",
|
| 142 |
),
|
| 143 |
gr.Slider(
|
| 144 |
minimum=0,
|
| 145 |
maximum=100,
|
| 146 |
-
value=
|
| 147 |
step=1,
|
| 148 |
label="Top-k",
|
| 149 |
),
|
|
@@ -181,9 +168,7 @@ If you need to correct yourself:
|
|
| 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 |
],
|
|
|
|
| 41 |
llm = Llama(
|
| 42 |
model_path=f"models/{model}",
|
| 43 |
n_gpu_layers=0,
|
| 44 |
+
n_batch=32000,
|
| 45 |
+
n_ctx=2048,
|
| 46 |
)
|
| 47 |
llm_model = model
|
| 48 |
|
|
|
|
| 107 |
value="llama-3.2-1b-instruct-q4_k_m.gguf",
|
| 108 |
label="Model"
|
| 109 |
),
|
| 110 |
+
gr.TextArea(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
|
|
|
|
| 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 |
+
""", label="System message"),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 121 |
gr.Slider(minimum=1, maximum=2048, value=1024, step=1, label="Max tokens"),
|
| 122 |
gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
|
| 123 |
gr.Slider(
|
| 124 |
minimum=0.1,
|
| 125 |
maximum=2.0,
|
| 126 |
+
value=0.95,
|
| 127 |
step=0.05,
|
| 128 |
label="Top-p",
|
| 129 |
),
|
| 130 |
gr.Slider(
|
| 131 |
minimum=0,
|
| 132 |
maximum=100,
|
| 133 |
+
value=40,
|
| 134 |
step=1,
|
| 135 |
label="Top-k",
|
| 136 |
),
|
|
|
|
| 168 |
["Can you explain the concept of photosynthesis?"],
|
| 169 |
["Write a short story about a robot learning to paint."],
|
| 170 |
["Explain the difference between machine learning and deep learning."],
|
|
|
|
| 171 |
["Summarize the key points of climate change and its global impact."],
|
|
|
|
| 172 |
["Explain quantum computing to a 10-year-old."],
|
| 173 |
["Design a step-by-step meal plan for someone trying to lose weight and build muscle."]
|
| 174 |
],
|