ryanpdwyer commited on
Commit
951d064
1 Parent(s): 3c111ba

Switched to optimum.nvidia

Browse files
Files changed (2) hide show
  1. app.py +2 -2
  2. requirements.txt +2 -3
app.py CHANGED
@@ -1,5 +1,5 @@
1
  import streamlit as st
2
- from transformers import pipeline
3
  import torch
4
  import os
5
  import sys
@@ -18,7 +18,7 @@ if not hf_token:
18
  def load_pipeline(model_name):
19
  with st.spinner(f'Loading {model_name}... This may take several minutes.'):
20
  try:
21
- pipe = pipeline("text-generation", model=model_name,device=-1)
22
  except Exception as e:
23
  st.error(f"An error occurred: {e}")
24
  st.stop()
 
1
  import streamlit as st
2
+ from optimum.nvidia.pipelines import pipeline
3
  import torch
4
  import os
5
  import sys
 
18
  def load_pipeline(model_name):
19
  with st.spinner(f'Loading {model_name}... This may take several minutes.'):
20
  try:
21
+ pipe = pipeline("text-generation", model=model_name,use_fp8=True)
22
  except Exception as e:
23
  st.error(f"An error occurred: {e}")
24
  st.stop()
requirements.txt CHANGED
@@ -1,5 +1,4 @@
1
  streamlit
2
- transformers
3
  torch
4
- bitsandbytes==0.39.1
5
- accelerate
 
1
  streamlit
 
2
  torch
3
+ --extra-index-url https://pypi.nvidia.com
4
+ optimum-nvidia