PhantHive commited on
Commit
327ad9f
1 Parent(s): 7a6d2f1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -1,14 +1,14 @@
1
  import gradio as gr
2
  from peft import PeftModel, PeftConfig
3
  from transformers import AutoModelForCausalLM, AutoTokenizer
4
- import torch
 
5
 
6
  # Device configuration (prioritize GPU if available)
7
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
8
 
9
  # Load models and tokenizer efficiently
10
- model_id = "phearion/bigbrain-v0.0.1"
11
- config = PeftConfig.from_pretrained(model_id=model_id)
12
  tokenizer = AutoTokenizer.from_pretrained(config.base_model_name_or_path)
13
  model = PeftModel.from_pretrained(model_id)
14
  model.to(device)
 
1
  import gradio as gr
2
  from peft import PeftModel, PeftConfig
3
  from transformers import AutoModelForCausalLM, AutoTokenizer
4
+ import
5
+ torch
6
 
7
  # Device configuration (prioritize GPU if available)
8
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
9
 
10
  # Load models and tokenizer efficiently
11
+ config = PeftConfig.from_pretrained("phearion/bigbrain-v0.0.1")
 
12
  tokenizer = AutoTokenizer.from_pretrained(config.base_model_name_or_path)
13
  model = PeftModel.from_pretrained(model_id)
14
  model.to(device)