Hemanth-thunder
commited on
Commit
·
8866047
1
Parent(s):
78a4974
prompt variable change within function
Browse files
app.py
CHANGED
@@ -6,20 +6,24 @@ model_file = "tamil-mistral-7b-instruct-v0.1.Q4_K_M.gguf"
|
|
6 |
|
7 |
model_path = hf_hub_download(model_name, filename=model_file)
|
8 |
|
9 |
-
prompt = """<s> சரியான பதிலுடன் வேலையை வெற்றிகரமாக முடிக்க. தேவையான தகவலை உள்ளிடவும்.
|
10 |
|
11 |
-
### Instruction:
|
12 |
-
{}
|
13 |
-
|
14 |
-
### Response:
|
15 |
-
"""
|
16 |
|
17 |
|
18 |
llm = AutoModelForCausalLM.from_pretrained(model_name, model_file=model_file,
|
19 |
model_type="mistral", gpu_layers=0)
|
20 |
def alternatingly_agree(message, history):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
prompt = prompt.format(message)
|
22 |
-
result = llm(
|
23 |
for i in result:
|
24 |
yield i
|
25 |
|
|
|
6 |
|
7 |
model_path = hf_hub_download(model_name, filename=model_file)
|
8 |
|
|
|
9 |
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
|
12 |
llm = AutoModelForCausalLM.from_pretrained(model_name, model_file=model_file,
|
13 |
model_type="mistral", gpu_layers=0)
|
14 |
def alternatingly_agree(message, history):
|
15 |
+
|
16 |
+
prompt = """<s> சரியான பதிலுடன் வேலையை வெற்றிகரமாக முடிக்க. தேவையான தகவலை உள்ளிடவும்.
|
17 |
+
|
18 |
+
### Instruction:
|
19 |
+
{}
|
20 |
+
|
21 |
+
### Response:
|
22 |
+
"""
|
23 |
+
|
24 |
+
|
25 |
prompt = prompt.format(message)
|
26 |
+
result = llm(prompt,max_new_tokens=50,temperature=0.7,stream=True)
|
27 |
for i in result:
|
28 |
yield i
|
29 |
|