Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
import streamlit as st
|
2 |
import os
|
3 |
-
from transformers import AutoModelForCausalLM, AutoTokenizer
|
4 |
from huggingface_hub import login
|
5 |
import torch
|
6 |
|
@@ -9,8 +9,8 @@ class VietnameseChatbot:
|
|
9 |
"""
|
10 |
Initialize the Vietnamese chatbot with a pre-trained model
|
11 |
"""
|
12 |
-
self.tokenizer = AutoTokenizer.from_pretrained(model_name)
|
13 |
-
self.model =
|
14 |
|
15 |
# Use GPU if available
|
16 |
self.device = "cuda" if torch.cuda.is_available() else "cpu"
|
|
|
1 |
import streamlit as st
|
2 |
import os
|
3 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer, AutoModel
|
4 |
from huggingface_hub import login
|
5 |
import torch
|
6 |
|
|
|
9 |
"""
|
10 |
Initialize the Vietnamese chatbot with a pre-trained model
|
11 |
"""
|
12 |
+
#self.tokenizer = AutoTokenizer.from_pretrained(model_name)
|
13 |
+
self.model = AutoModel.from_pretrained("TheBloke/Llama-2-7B-Chat-GGML")
|
14 |
|
15 |
# Use GPU if available
|
16 |
self.device = "cuda" if torch.cuda.is_available() else "cpu"
|