dwb2023 commited on
Commit
68f9e87
1 Parent(s): 0d18b6e

Update app.py

Browse files

update model class to AutoModelForCausalLM

Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -2,7 +2,7 @@ import gradio as gr
2
  import os
3
  import torch
4
  import spaces
5
- from transformers import AutoModel
6
  from huggingface_hub import login
7
 
8
  hf_token = os.getenv("HF_TOKEN")
@@ -14,7 +14,7 @@ def get_model_summary(model_name):
14
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
15
 
16
  # Load the model and move it to the selected device
17
- model = AutoModel.from_pretrained(model_name, trust_remote_code=True).to(device)
18
 
19
  # Return the model's architecture as a string
20
  return str(model)
 
2
  import os
3
  import torch
4
  import spaces
5
+ from transformers import AutoModelForCausalLM
6
  from huggingface_hub import login
7
 
8
  hf_token = os.getenv("HF_TOKEN")
 
14
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
15
 
16
  # Load the model and move it to the selected device
17
+ model = AutoModelForCausalLM.from_pretrained(model_name, trust_remote_code=True).to(device)
18
 
19
  # Return the model's architecture as a string
20
  return str(model)