Spaces:
Running
on
T4
Running
on
T4
Merge pull request #3 from patrikwm/main
Browse files- app.py +5 -2
- tabs/htr_tool.py +4 -2
- tabs/stepwise_htr_tool.py +4 -1
app.py
CHANGED
@@ -1,11 +1,15 @@
|
|
1 |
import os
|
|
|
|
|
|
|
|
|
2 |
import uuid
|
3 |
|
4 |
import gradio as gr
|
5 |
|
6 |
from helper.gradio_config import css, theme
|
7 |
from helper.text.text_app import TextApp
|
8 |
-
|
9 |
from tabs.htr_tool import htr_tool_tab
|
10 |
from tabs.overview_tab import overview
|
11 |
from tabs.stepwise_htr_tool import stepwise_htr_tool_tab
|
@@ -46,7 +50,6 @@ with gr.Blocks(title="Riksarkivet", theme=theme, css=css) as demo:
|
|
46 |
format="mp4",
|
47 |
)
|
48 |
|
49 |
-
SECRET_KEY = os.environ.get("HUB_TOKEN", False)
|
50 |
if SECRET_KEY:
|
51 |
demo.load(
|
52 |
fn=TrafficDataHandler.onload_store_metric_data,
|
|
|
1 |
import os
|
2 |
+
SECRET_KEY = os.environ.get("HUB_TOKEN", False)
|
3 |
+
if SECRET_KEY:
|
4 |
+
from helper.utils import TrafficDataHandler
|
5 |
+
|
6 |
import uuid
|
7 |
|
8 |
import gradio as gr
|
9 |
|
10 |
from helper.gradio_config import css, theme
|
11 |
from helper.text.text_app import TextApp
|
12 |
+
|
13 |
from tabs.htr_tool import htr_tool_tab
|
14 |
from tabs.overview_tab import overview
|
15 |
from tabs.stepwise_htr_tool import stepwise_htr_tool_tab
|
|
|
50 |
format="mp4",
|
51 |
)
|
52 |
|
|
|
53 |
if SECRET_KEY:
|
54 |
demo.load(
|
55 |
fn=TrafficDataHandler.onload_store_metric_data,
|
tabs/htr_tool.py
CHANGED
@@ -1,9 +1,11 @@
|
|
1 |
import os
|
2 |
-
|
|
|
|
|
|
|
3 |
import gradio as gr
|
4 |
|
5 |
from helper.examples.examples import DemoImages
|
6 |
-
from helper.utils import TrafficDataHandler
|
7 |
from src.htr_pipeline.gradio_backend import (
|
8 |
FastTrack,
|
9 |
SingletonModelLoader,
|
|
|
1 |
import os
|
2 |
+
SECRET_KEY = os.environ.get("HUB_TOKEN", False)
|
3 |
+
if SECRET_KEY:
|
4 |
+
from helper.utils import TrafficDataHandler
|
5 |
+
|
6 |
import gradio as gr
|
7 |
|
8 |
from helper.examples.examples import DemoImages
|
|
|
9 |
from src.htr_pipeline.gradio_backend import (
|
10 |
FastTrack,
|
11 |
SingletonModelLoader,
|
tabs/stepwise_htr_tool.py
CHANGED
@@ -1,4 +1,8 @@
|
|
1 |
import os
|
|
|
|
|
|
|
|
|
2 |
import shutil
|
3 |
from difflib import Differ
|
4 |
|
@@ -6,7 +10,6 @@ import evaluate
|
|
6 |
import gradio as gr
|
7 |
|
8 |
from helper.examples.examples import DemoImages
|
9 |
-
from helper.utils import TrafficDataHandler
|
10 |
from src.htr_pipeline.gradio_backend import CustomTrack, SingletonModelLoader
|
11 |
|
12 |
model_loader = SingletonModelLoader()
|
|
|
1 |
import os
|
2 |
+
SECRET_KEY = os.environ.get("HUB_TOKEN", False)
|
3 |
+
if SECRET_KEY:
|
4 |
+
from helper.utils import TrafficDataHandler
|
5 |
+
|
6 |
import shutil
|
7 |
from difflib import Differ
|
8 |
|
|
|
10 |
import gradio as gr
|
11 |
|
12 |
from helper.examples.examples import DemoImages
|
|
|
13 |
from src.htr_pipeline.gradio_backend import CustomTrack, SingletonModelLoader
|
14 |
|
15 |
model_loader = SingletonModelLoader()
|