Spaces:
Running
on
Zero
Running
on
Zero
fix bug
Browse files
app.py
CHANGED
@@ -14,15 +14,14 @@ DESCRIPTION = """\
|
|
14 |
# IndicTrans3-beta ๐
|
15 |
"""
|
16 |
|
17 |
-
if not torch.cuda.is_available():
|
18 |
-
|
19 |
|
20 |
|
21 |
-
if torch.cuda.is_available():
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
tokenizer.use_default_system_prompt = False
|
26 |
|
27 |
|
28 |
LANGUAGES = {
|
|
|
14 |
# IndicTrans3-beta ๐
|
15 |
"""
|
16 |
|
17 |
+
# if not torch.cuda.is_available():
|
18 |
+
# DESCRIPTION += "\n<p>Running on CPU ๐ฅถ This demo does not work on CPU.</p>"
|
19 |
|
20 |
|
21 |
+
# if torch.cuda.is_available():
|
22 |
+
model_id = "ai4bharat/IndicTrans3-beta"
|
23 |
+
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.float16, device_map="auto")
|
24 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
|
|
25 |
|
26 |
|
27 |
LANGUAGES = {
|