richardcsuwandi commited on
Commit
21fd9aa
·
verified ·
1 Parent(s): 0a6c4da

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -2,7 +2,7 @@ import gradio as gr
2
  from transformers import AutoModelForCausalLM, AutoTokenizer
3
  import torch
4
 
5
- # Load your 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,8 +18,7 @@ def respond(
18
  temperature,
19
  top_p,
20
  ):
21
- # Prepare the instruction prompt and input text
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