Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -25,6 +25,7 @@ class RAGInterface:
|
|
25 |
self.llm = Llama.from_pretrained(
|
26 |
repo_id="bartowski/Llama-3.2-1B-Instruct-GGUF",
|
27 |
filename="Llama-3.2-1B-Instruct-Q8_0.gguf",
|
|
|
28 |
)
|
29 |
|
30 |
# Define RAG prompt template
|
@@ -42,7 +43,7 @@ class RAGInterface:
|
|
42 |
"""
|
43 |
self.prompt = PromptTemplate.from_template(self.template)
|
44 |
|
45 |
-
def respond(self, message, history, system_message, max_tokens
|
46 |
# Build messages list
|
47 |
messages = [{"role": "system", "content": system_message}]
|
48 |
for user_msg, assistant_msg in history:
|
@@ -160,14 +161,14 @@ class RAGInterface:
|
|
160 |
label="System Message",
|
161 |
elem_classes="control-panel"
|
162 |
),
|
163 |
-
gr.Slider(
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
),
|
171 |
gr.Slider(
|
172 |
minimum=0.1,
|
173 |
maximum=1.0,
|
|
|
25 |
self.llm = Llama.from_pretrained(
|
26 |
repo_id="bartowski/Llama-3.2-1B-Instruct-GGUF",
|
27 |
filename="Llama-3.2-1B-Instruct-Q8_0.gguf",
|
28 |
+
n_ctx=2048
|
29 |
)
|
30 |
|
31 |
# Define RAG prompt template
|
|
|
43 |
"""
|
44 |
self.prompt = PromptTemplate.from_template(self.template)
|
45 |
|
46 |
+
def respond(self, message, history, system_message, temperature,max_tokens=2048):
|
47 |
# Build messages list
|
48 |
messages = [{"role": "system", "content": system_message}]
|
49 |
for user_msg, assistant_msg in history:
|
|
|
161 |
label="System Message",
|
162 |
elem_classes="control-panel"
|
163 |
),
|
164 |
+
# gr.Slider(
|
165 |
+
# minimum=1,
|
166 |
+
# maximum=2048,
|
167 |
+
# value=512,
|
168 |
+
# step=1,
|
169 |
+
# label="Max New Tokens",
|
170 |
+
# elem_classes="control-panel"
|
171 |
+
# ),
|
172 |
gr.Slider(
|
173 |
minimum=0.1,
|
174 |
maximum=1.0,
|