rbughao commited on
Commit
a2da4cb
·
verified ·
1 Parent(s): 61ba76d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -5,10 +5,11 @@ import gradio as gr
5
  from llama_index.readers.file import PDFReader
6
 
7
  ### added to remove openapi
8
- import torch
 
9
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
10
  model_name = "baffo32/decapoda-research-llama-7B-hf"
11
- model = torch.hub.load("HuggingFace", "transformers", model_name).to(device)
12
 
13
  ### added to remove openapi
14
 
 
5
  from llama_index.readers.file import PDFReader
6
 
7
  ### added to remove openapi
8
+ from transformers import AutoModelForCausalLM
9
+
10
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
11
  model_name = "baffo32/decapoda-research-llama-7B-hf"
12
+ model = AutoModelForCausalLM.from_pretrained(model_name).to(device)
13
 
14
  ### added to remove openapi
15