Haseeb javed
commited on
Commit
·
a58a3ee
1
Parent(s):
db9fe30
3:37
Browse files
app.py
CHANGED
@@ -11,8 +11,8 @@ logging.basicConfig(level=logging.DEBUG)
|
|
11 |
# Load tokenizer and model
|
12 |
logging.info("Loading model...")
|
13 |
model_repo = "hsb06/toghetherAi-model"
|
14 |
-
tokenizer = AutoTokenizer.from_pretrained(model_repo
|
15 |
-
model = AutoModelForCausalLM.from_pretrained(model_repo, torch_dtype=torch.float16
|
16 |
logging.info("Model loaded successfully.")
|
17 |
|
18 |
# Initialize Flask app
|
|
|
11 |
# Load tokenizer and model
|
12 |
logging.info("Loading model...")
|
13 |
model_repo = "hsb06/toghetherAi-model"
|
14 |
+
tokenizer = AutoTokenizer.from_pretrained(model_repo)
|
15 |
+
model = AutoModelForCausalLM.from_pretrained(model_repo, torch_dtype=torch.float16).to("cuda" if torch.cuda.is_available() else "cpu")
|
16 |
logging.info("Model loaded successfully.")
|
17 |
|
18 |
# Initialize Flask app
|