Spaces:
Sleeping
Sleeping
Ezi Ozoani
commited on
Commit
·
713078a
1
Parent(s):
dd4a89f
..
Browse files- app.py +6 -1
- requirements.txt +2 -1
app.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
from pathlib import Path
|
| 3 |
import base64
|
|
|
|
| 4 |
from transformers import pipeline
|
| 5 |
from PIL import Image
|
| 6 |
|
|
@@ -17,6 +18,7 @@ st.set_page_config(
|
|
| 17 |
def main():
|
| 18 |
cs_sidebar()
|
| 19 |
cs_body()
|
|
|
|
| 20 |
|
| 21 |
return None
|
| 22 |
|
|
@@ -29,6 +31,9 @@ def img_to_bytes(img_path):
|
|
| 29 |
|
| 30 |
# sidebar
|
| 31 |
|
|
|
|
|
|
|
|
|
|
| 32 |
def cs_sidebar():
|
| 33 |
|
| 34 |
|
|
@@ -284,7 +289,7 @@ were utilized to estimate the carbon impact.*
|
|
| 284 |
|
| 285 |
|
| 286 |
|
| 287 |
-
pipeline = pipeline(task="image-classification", model="julien-c/hotdog-not-hotdog")
|
| 288 |
|
| 289 |
# Placeholders, help, and options
|
| 290 |
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
from pathlib import Path
|
| 3 |
import base64
|
| 4 |
+
#import transformers
|
| 5 |
from transformers import pipeline
|
| 6 |
from PIL import Image
|
| 7 |
|
|
|
|
| 18 |
def main():
|
| 19 |
cs_sidebar()
|
| 20 |
cs_body()
|
| 21 |
+
load_model()
|
| 22 |
|
| 23 |
return None
|
| 24 |
|
|
|
|
| 31 |
|
| 32 |
# sidebar
|
| 33 |
|
| 34 |
+
def load_model():
|
| 35 |
+
pipeline = pipeline(task="image-classification", model="distilgpt2")
|
| 36 |
+
|
| 37 |
def cs_sidebar():
|
| 38 |
|
| 39 |
|
|
|
|
| 289 |
|
| 290 |
|
| 291 |
|
| 292 |
+
#pipeline = pipeline(task="image-classification", model="julien-c/hotdog-not-hotdog")
|
| 293 |
|
| 294 |
# Placeholders, help, and options
|
| 295 |
|
requirements.txt
CHANGED
|
@@ -1,2 +1,3 @@
|
|
| 1 |
transformers
|
| 2 |
-
torch
|
|
|
|
|
|
| 1 |
transformers
|
| 2 |
+
torch
|
| 3 |
+
transformers-interpret
|