thanglekdi commited on
Commit
81050d1
·
1 Parent(s): cf42bd0
Files changed (1) hide show
  1. app.py +4 -7
app.py CHANGED
@@ -1,13 +1,10 @@
1
  # app_phogpt4b_chat.py
2
  import gradio as gr
3
- from transformers import pipeline
 
4
 
5
- # 1️⃣ Tạo pipeline với PhoGPT-4B-Chat
6
- pipe = pipeline(
7
- "text-generation",
8
- model="vinai/PhoGPT-4B-Chat",
9
- trust_remote_code=True
10
- )
11
 
12
  # 2️⃣ Hàm chat handler
13
  def respond(message, history):
 
1
  # app_phogpt4b_chat.py
2
  import gradio as gr
3
+ # Load model directly
4
+ from transformers import AutoTokenizer, AutoModelForCausalLM
5
 
6
+ tokenizer = AutoTokenizer.from_pretrained("vinai/PhoGPT-4B-Chat", trust_remote_code=True)
7
+ model = AutoModelForCausalLM.from_pretrained("vinai/PhoGPT-4B-Chat", trust_remote_code=True)
 
 
 
 
8
 
9
  # 2️⃣ Hàm chat handler
10
  def respond(message, history):