NotRev commited on
Commit
da762f1
·
verified ·
1 Parent(s): 0d6e70e

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +2 -2
src/streamlit_app.py CHANGED
@@ -1,6 +1,6 @@
1
  import json, re, ast, streamlit as st
2
  from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
3
- import torch # Still needed for torch_dtype="auto" and device_map
4
 
5
  # SWITCHED MODEL: From Mistral-7B to the much smaller Gemma-2B-Instruct
6
  model_id = "google/gemma-2b-it"
@@ -12,7 +12,7 @@ tok = AutoTokenizer.from_pretrained(model_id)
12
  try:
13
  model = AutoModelForCausalLM.from_pretrained(
14
  model_id,
15
- torch_dtype=torch.bfloat16, # Use bfloat16 for better numerical stability if supported, otherwise auto
16
  device_map="auto"
17
  )
18
  except Exception:
 
1
  import json, re, ast, streamlit as st
2
  from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
3
+ import torch
4
 
5
  # SWITCHED MODEL: From Mistral-7B to the much smaller Gemma-2B-Instruct
6
  model_id = "google/gemma-2b-it"
 
12
  try:
13
  model = AutoModelForCausalLM.from_pretrained(
14
  model_id,
15
+ torch_dtype=torch.bfloat16,
16
  device_map="auto"
17
  )
18
  except Exception: