Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -30,6 +30,14 @@ routes.get_types = get_types
|
|
30 |
|
31 |
# App code
|
32 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
def chat(id, npc, prompt):
|
34 |
|
35 |
# get_coin endpoint
|
@@ -43,6 +51,11 @@ def chat(id, npc, prompt):
|
|
43 |
return "no coin"
|
44 |
|
45 |
# model inference
|
|
|
|
|
|
|
|
|
|
|
46 |
|
47 |
output = "AI μλ΅μ
λλ€."
|
48 |
|
|
|
30 |
|
31 |
# App code
|
32 |
|
33 |
+
model_name = "daekeun-ml/Llama-2-ko-instruct-13B"
|
34 |
+
|
35 |
+
#daekeun-ml/Llama-2-ko-instruct-13B
|
36 |
+
#quantumaikr/llama-2-70b-fb16-korean
|
37 |
+
|
38 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
39 |
+
model = AutoDistributedModelForCausalLM.from_pretrained(model_name)
|
40 |
+
|
41 |
def chat(id, npc, prompt):
|
42 |
|
43 |
# get_coin endpoint
|
|
|
51 |
return "no coin"
|
52 |
|
53 |
# model inference
|
54 |
+
|
55 |
+
prom = ""
|
56 |
+
inputs = tokenizer(prom, return_tensors="pt")["input_ids"]
|
57 |
+
outputs = model.generate(inputs, max_new_tokens=100)
|
58 |
+
print(tokenizer.decode(outputs[0]))
|
59 |
|
60 |
output = "AI μλ΅μ
λλ€."
|
61 |
|