forked from marc-shade/Ollama-Workbench
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathui_elements.py
More file actions
38 lines (33 loc) · 1.07 KB
/
ui_elements.py
File metadata and controls
38 lines (33 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# ui_elements.py
import streamlit as st
import re
from ollama_utils import *
from model_tests import *
from local_models import *
from model_comparison import *
from vision_comparison import *
from chat_interface import *
from brainstorm import *
from web_to_corpus import *
from contextual_response import *
from feature_test import *
from file_management import *
from corpus_management import *
from server_configuration import *
from server_monitoring import *
from pull_model import *
from show_model import *
from remove_model import *
from update_models import *
def manage_prompts_interface():
manage_prompts()
def update_model_selection(selected_models, key):
"""Callback function to update session state during form submission."""
st.session_state[key] = selected_models
def extract_code_blocks(text):
# Simple regex to extract code blocks (text between triple backticks)
code_blocks = re.findall(r'```[\s\S]*?```', text)
# Remove the backticks
return [block.strip('`').strip() for block in code_blocks]
def brainstorm_interface():
brainstorm_session()