legaltextai commited on
Commit
a65b66d
Β·
verified Β·
1 Parent(s): 5b130c8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -1,13 +1,15 @@
1
  import gradio as gr
2
  import spaces
3
  from transformers import pipeline
 
4
 
 
5
  model = pipeline(
6
  "text-generation",
7
  model="unsloth/DeepSeek-R1-Distill-Llama-8B",
8
  device_map="auto",
9
- torch_dtype=torch.float16, # Explicit dtype
10
- model_kwargs={"load_in_8bit": True}, # Reduces VRAM usage
11
  )
12
 
13
  @spaces.GPU(duration=300) # Increased to 5 minutes
 
1
  import gradio as gr
2
  import spaces
3
  from transformers import pipeline
4
+ import torch
5
 
6
+ # Initialize model with explicit dtype
7
  model = pipeline(
8
  "text-generation",
9
  model="unsloth/DeepSeek-R1-Distill-Llama-8B",
10
  device_map="auto",
11
+ torch_dtype=torch.float16, # Now recognizes 'torch'
12
+ model_kwargs={"load_in_8bit": True}
13
  )
14
 
15
  @spaces.GPU(duration=300) # Increased to 5 minutes