Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -7,17 +7,17 @@ def fmt_prompt(prompt: str) -> str:
|
|
7 |
return f"""[Instructions]:\n{prompt}\n\n[Response]:"""
|
8 |
|
9 |
|
10 |
-
|
11 |
-
model_name = "abacaj/starcoderbase-1b-sft"
|
12 |
-
tokenizer = transformers.AutoTokenizer.from_pretrained(model_name)
|
13 |
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
)
|
|
|
|
|
|
|
21 |
def chat_fn(prompt):
|
22 |
#prompt = "Write a python function to sort the following array in ascending order, don't use any built in sorting methods: [9,2,8,1,5]"
|
23 |
prompt_input = fmt_prompt(prompt)
|
|
|
7 |
return f"""[Instructions]:\n{prompt}\n\n[Response]:"""
|
8 |
|
9 |
|
|
|
|
|
|
|
10 |
|
11 |
+
model_name = "abacaj/starcoderbase-1b-sft"
|
12 |
+
tokenizer = transformers.AutoTokenizer.from_pretrained(model_name)
|
13 |
+
|
14 |
+
model = (
|
15 |
+
transformers.AutoModelForCausalLM.from_pretrained(
|
16 |
+
model_name,
|
17 |
)
|
18 |
+
.to("cuda:0")
|
19 |
+
.eval()
|
20 |
+
)
|
21 |
def chat_fn(prompt):
|
22 |
#prompt = "Write a python function to sort the following array in ascending order, don't use any built in sorting methods: [9,2,8,1,5]"
|
23 |
prompt_input = fmt_prompt(prompt)
|