Spaces:
Runtime error
Runtime error
Changed function name as getting a conflict on the server which I am not getting locally
Browse files- pages/010_LLM_Architectures.py +2 -2
- src/common.py +10 -1
pages/010_LLM_Architectures.py
CHANGED
@@ -4,7 +4,7 @@ import streamlit as st
|
|
4 |
from time import time
|
5 |
|
6 |
from src.st_helpers import st_setup
|
7 |
-
from src.common import img_dir, escape_dollars,
|
8 |
from src.architectures import *
|
9 |
|
10 |
|
@@ -39,7 +39,7 @@ def show_side_by_side() -> None:
|
|
39 |
# Now dispatch the messages per architecture
|
40 |
for i, a in enumerate(Architecture.architectures):
|
41 |
request = ArchitectureRequest(query=prompt)
|
42 |
-
group_tag =
|
43 |
with arch_cols[i]:
|
44 |
with st.spinner('Architecture processing request'):
|
45 |
start = time()
|
|
|
4 |
from time import time
|
5 |
|
6 |
from src.st_helpers import st_setup
|
7 |
+
from src.common import img_dir, escape_dollars, generate_group_tag
|
8 |
from src.architectures import *
|
9 |
|
10 |
|
|
|
39 |
# Now dispatch the messages per architecture
|
40 |
for i, a in enumerate(Architecture.architectures):
|
41 |
request = ArchitectureRequest(query=prompt)
|
42 |
+
group_tag = generate_group_tag()
|
43 |
with arch_cols[i]:
|
44 |
with st.spinner('Architecture processing request'):
|
45 |
start = time()
|
src/common.py
CHANGED
@@ -2,7 +2,8 @@ import os
|
|
2 |
import requests
|
3 |
import streamlit as st
|
4 |
|
5 |
-
from random import getrandbits
|
|
|
6 |
from typing import List, Tuple
|
7 |
|
8 |
|
@@ -33,6 +34,14 @@ def pop_n(items: List, n: int) -> List:
|
|
33 |
return popped[::-1]
|
34 |
|
35 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
def hf_api_token(write: bool = False) -> str:
|
37 |
"""
|
38 |
Utility single access point to look up the hugging face access token.
|
|
|
2 |
import requests
|
3 |
import streamlit as st
|
4 |
|
5 |
+
from random import getrandbits, randint
|
6 |
+
from time import time
|
7 |
from typing import List, Tuple
|
8 |
|
9 |
|
|
|
34 |
return popped[::-1]
|
35 |
|
36 |
|
37 |
+
def generate_group_tag() -> str:
|
38 |
+
"""
|
39 |
+
Generates a pseduo-random test group ID for tagging requests which
|
40 |
+
should be considered together
|
41 |
+
"""
|
42 |
+
return f"TestGroup_{randint()}_{time()}"
|
43 |
+
|
44 |
+
|
45 |
def hf_api_token(write: bool = False) -> str:
|
46 |
"""
|
47 |
Utility single access point to look up the hugging face access token.
|