Spaces:
Build error
Build error
Commit
·
951d064
1
Parent(s):
3c111ba
Switched to optimum.nvidia
Browse files- app.py +2 -2
- requirements.txt +2 -3
app.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
-
from
|
| 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,
|
| 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 |
-
|
| 5 |
-
|
|
|
|
| 1 |
streamlit
|
|
|
|
| 2 |
torch
|
| 3 |
+
--extra-index-url https://pypi.nvidia.com
|
| 4 |
+
optimum-nvidia
|