Tonic commited on
Commit
b0f5b7b
1 Parent(s): cfcb9b3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -1,6 +1,6 @@
1
  import spaces
2
  import gradio as gr
3
- from transformers import AutoModelForCausalLM, AutoTokenizer
4
  import torch
5
  from gradio_rich_textbox import RichTextbox
6
 
@@ -15,7 +15,7 @@ model_path = "NousResearch/Genstruct-7B"
15
 
16
  tokenizer = AutoTokenizer.from_pretrained(model_path)
17
  quantization_config = BitsAndBytesConfig(load_in_8bit=True)
18
- model = AutoModelForCausalLM.from_pretrained( model_path, device_map='cuda', quantization_config=quantization_config)
19
 
20
  @spaces.GPU
21
  def generate_text(prompt, custom_prompt, temperature, max_length):
 
1
  import spaces
2
  import gradio as gr
3
+ from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
4
  import torch
5
  from gradio_rich_textbox import RichTextbox
6
 
 
15
 
16
  tokenizer = AutoTokenizer.from_pretrained(model_path)
17
  quantization_config = BitsAndBytesConfig(load_in_8bit=True)
18
+ model = AutoModelForCausalLM.from_pretrained(model_path, device_map='cuda', quantization_config=quantization_config)
19
 
20
  @spaces.GPU
21
  def generate_text(prompt, custom_prompt, temperature, max_length):