Commit
·
84ab38f
1
Parent(s):
3f775b2
caching create pipeline
Browse files- hanlde_form_submit.py +2 -0
hanlde_form_submit.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
import os
|
|
|
|
| 2 |
from time import time
|
| 3 |
|
| 4 |
import streamlit as st
|
|
@@ -18,6 +19,7 @@ def is_downloaded(model_name: str) -> bool:
|
|
| 18 |
return os.path.isdir(model_dir)
|
| 19 |
|
| 20 |
|
|
|
|
| 21 |
def create_pipeline(model_name: str, group_size: int) -> GroupedSamplingPipeLine:
|
| 22 |
"""
|
| 23 |
Creates a pipeline with the given model name and group size.
|
|
|
|
| 1 |
import os
|
| 2 |
+
from functools import lru_cache
|
| 3 |
from time import time
|
| 4 |
|
| 5 |
import streamlit as st
|
|
|
|
| 19 |
return os.path.isdir(model_dir)
|
| 20 |
|
| 21 |
|
| 22 |
+
@lru_cache()
|
| 23 |
def create_pipeline(model_name: str, group_size: int) -> GroupedSamplingPipeLine:
|
| 24 |
"""
|
| 25 |
Creates a pipeline with the given model name and group size.
|