Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -8,7 +8,7 @@ from transformers import SamModel, SamProcessor
|
|
8 |
|
9 |
# Load the processor and the finetuned model
|
10 |
processor = SamProcessor.from_pretrained("facebook/sam-vit-base")
|
11 |
-
model_path = "
|
12 |
model = SamModel.from_pretrained("facebook/sam-vit-base")
|
13 |
model.load_state_dict(torch.load(model_path, map_location=torch.device('cpu')))
|
14 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
@@ -85,4 +85,4 @@ def server(input, output, session):
|
|
85 |
|
86 |
# Create and run the Shiny app
|
87 |
app = App(app_ui, server)
|
88 |
-
app.run(port=
|
|
|
8 |
|
9 |
# Load the processor and the finetuned model
|
10 |
processor = SamProcessor.from_pretrained("facebook/sam-vit-base")
|
11 |
+
model_path = "mito_model_checkpoint.pth"
|
12 |
model = SamModel.from_pretrained("facebook/sam-vit-base")
|
13 |
model.load_state_dict(torch.load(model_path, map_location=torch.device('cpu')))
|
14 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
|
|
85 |
|
86 |
# Create and run the Shiny app
|
87 |
app = App(app_ui, server)
|
88 |
+
app.run(port=7860)
|