Update app.py
Browse files
app.py
CHANGED
|
@@ -2,7 +2,7 @@ import gradio as gr
|
|
| 2 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 3 |
import torch
|
| 4 |
|
| 5 |
-
# Load
|
| 6 |
model_name = "richardcsuwandi/llama2-javanese"
|
| 7 |
|
| 8 |
model = AutoModelForCausalLM.from_pretrained(model_name, device_map="auto", torch_dtype=torch.bfloat16)
|
|
@@ -18,8 +18,7 @@ def respond(
|
|
| 18 |
temperature,
|
| 19 |
top_p,
|
| 20 |
):
|
| 21 |
-
#
|
| 22 |
-
instruction_prompt = "Sampeyan minangka chatbot umum sing tansah mangsuli nganggo basa Jawa."
|
| 23 |
input_text = f"<s>[INST] <<SYS>> {system_message} <</SYS>> {message} [/INST]"
|
| 24 |
|
| 25 |
# Tokenize the input text
|
|
|
|
| 2 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 3 |
import torch
|
| 4 |
|
| 5 |
+
# Load the fine-tuned model and tokenizer
|
| 6 |
model_name = "richardcsuwandi/llama2-javanese"
|
| 7 |
|
| 8 |
model = AutoModelForCausalLM.from_pretrained(model_name, device_map="auto", torch_dtype=torch.bfloat16)
|
|
|
|
| 18 |
temperature,
|
| 19 |
top_p,
|
| 20 |
):
|
| 21 |
+
# Format the input text
|
|
|
|
| 22 |
input_text = f"<s>[INST] <<SYS>> {system_message} <</SYS>> {message} [/INST]"
|
| 23 |
|
| 24 |
# Tokenize the input text
|