Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -9,6 +9,7 @@ import shinyswatch
|
|
9 |
from shiny import App, Inputs, Outputs, Session, reactive, render, req, ui
|
10 |
|
11 |
import os
|
|
|
12 |
from transformers import SamModel, SamConfig, SamProcessor
|
13 |
import torch
|
14 |
|
@@ -59,7 +60,6 @@ app_ui = ui.page_fillable(
|
|
59 |
|
60 |
|
61 |
def server(input: Inputs, output: Outputs, session: Session):
|
62 |
-
os.environ["TRANSFORMERS_CACHE"] = "./hf_cache"
|
63 |
# Load the model configuration
|
64 |
model_config = SamConfig.from_pretrained("facebook/sam-vit-base")
|
65 |
processor = SamProcessor.from_pretrained("facebook/sam-vit-base")
|
|
|
9 |
from shiny import App, Inputs, Outputs, Session, reactive, render, req, ui
|
10 |
|
11 |
import os
|
12 |
+
os.environ["TRANSFORMERS_CACHE"] = "./hf_cache"
|
13 |
from transformers import SamModel, SamConfig, SamProcessor
|
14 |
import torch
|
15 |
|
|
|
60 |
|
61 |
|
62 |
def server(input: Inputs, output: Outputs, session: Session):
|
|
|
63 |
# Load the model configuration
|
64 |
model_config = SamConfig.from_pretrained("facebook/sam-vit-base")
|
65 |
processor = SamProcessor.from_pretrained("facebook/sam-vit-base")
|