Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,8 +10,15 @@ st.title("Python Code Helper")
|
|
| 10 |
try:
|
| 11 |
info = st.empty()
|
| 12 |
info.markdown("#### :red[Model is Loading....]")
|
| 13 |
-
|
| 14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
device = torch.device("cuda" if torch.cuda.is_available() else 'cpu')
|
| 16 |
model = model.to(device)
|
| 17 |
info.markdown("#### :green[Model Loaded Successfully]")
|
|
|
|
| 10 |
try:
|
| 11 |
info = st.empty()
|
| 12 |
info.markdown("#### :red[Model is Loading....]")
|
| 13 |
+
|
| 14 |
+
model = AutoModelForCausalLM.from_pretrained(model_name, revision="main", use_auth_token=True)
|
| 15 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name, revision="main", use_auth_token=True, use_fast=True)
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
# model = AutoModelForCausalLM.from_pretrained(model_name)
|
| 21 |
+
# tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 22 |
device = torch.device("cuda" if torch.cuda.is_available() else 'cpu')
|
| 23 |
model = model.to(device)
|
| 24 |
info.markdown("#### :green[Model Loaded Successfully]")
|