Unverified Commit e483aae1 authored by Timothy Jaeryang Baek's avatar Timothy Jaeryang Baek Committed by GitHub
Browse files

Merge branch 'dev' into dev

parents 09357b6e 7b864d96
import sys
from contextlib import asynccontextmanager
from fastapi import FastAPI, Depends, HTTPException
from fastapi.routing import APIRoute
......@@ -46,7 +47,16 @@ import asyncio
import subprocess
import yaml
app = FastAPI()
@asynccontextmanager
async def lifespan(app: FastAPI):
log.info("startup_event")
# TODO: Check config.yaml file and create one
asyncio.create_task(start_litellm_background())
yield
app = FastAPI(lifespan=lifespan)
origins = ["*"]
......@@ -141,13 +151,6 @@ async def shutdown_litellm_background():
background_process = None
@app.on_event("startup")
async def startup_event():
log.info("startup_event")
# TODO: Check config.yaml file and create one
asyncio.create_task(start_litellm_background())
app.state.ENABLE_MODEL_FILTER = ENABLE_MODEL_FILTER
app.state.MODEL_FILTER_LIST = MODEL_FILTER_LIST
......
from contextlib import asynccontextmanager
from bs4 import BeautifulSoup
import json
import markdown
......@@ -92,7 +93,19 @@ https://github.com/open-webui/open-webui
"""
)
app = FastAPI(docs_url="/docs" if ENV == "dev" else None, redoc_url=None)
@asynccontextmanager
async def lifespan(app: FastAPI):
if ENABLE_LITELLM:
asyncio.create_task(start_litellm_background())
yield
if ENABLE_LITELLM:
await shutdown_litellm_background()
app = FastAPI(
docs_url="/docs" if ENV == "dev" else None, redoc_url=None, lifespan=lifespan
)
app.state.ENABLE_MODEL_FILTER = ENABLE_MODEL_FILTER
app.state.MODEL_FILTER_LIST = MODEL_FILTER_LIST
......@@ -211,12 +224,6 @@ async def check_url(request: Request, call_next):
return response
@app.on_event("startup")
async def on_startup():
if ENABLE_LITELLM:
asyncio.create_task(start_litellm_background())
app.mount("/api/v1", webui_app)
app.mount("/litellm/api", litellm_app)
......@@ -381,9 +388,3 @@ else:
log.warning(
f"Frontend build directory not found at '{FRONTEND_BUILD_DIR}'. Serving API only."
)
@app.on_event("shutdown")
async def shutdown_event():
if ENABLE_LITELLM:
await shutdown_litellm_background()
......@@ -76,7 +76,7 @@
"Chunk Overlap": "Chunk تداخل",
"Chunk Params": "Chunk المتغيرات",
"Chunk Size": "Chunk حجم",
"Citation": "",
"Citation": "اقتباس",
"Click here for help.": "أضغط هنا للمساعدة",
"Click here to": "",
"Click here to check other modelfiles.": "انقر هنا للتحقق من ملفات الموديلات الأخرى.",
......@@ -285,7 +285,7 @@
"New Chat": "دردشة جديدة",
"New Password": "كلمة المرور الجديدة",
"No results found": "",
"No source available": "",
"No source available": "لا يوجد مصدر متاح",
"Not factually correct": "ليس صحيحا من حيث الواقع",
"Not sure what to add?": "لست متأكدا ما يجب إضافته؟",
"Not sure what to write? Switch to": "لست متأكدا ماذا أكتب؟ التبديل إلى",
......@@ -407,7 +407,7 @@
"Sign Out": "تسجيل الخروج",
"Sign up": "تسجيل",
"Signing in": "جاري الدخول",
"Source": "",
"Source": "المصدر",
"Speech recognition error: {{error}}": "خطأ في التعرف على الكلام: {{error}}",
"Speech-to-Text Engine": "محرك تحويل الكلام إلى نص",
"SpeechRecognition API is not supported in this browser.": "API SpeechRecognition غير مدعومة في هذا المتصفح.",
......
......@@ -76,7 +76,7 @@
"Chunk Overlap": "Chunk Overlap",
"Chunk Params": "Chunk Params",
"Chunk Size": "Chunk Size",
"Citation": "",
"Citation": "Цитат",
"Click here for help.": "Натиснете тук за помощ.",
"Click here to": "",
"Click here to check other modelfiles.": "Натиснете тук за проверка на други моделфайлове.",
......@@ -285,7 +285,7 @@
"New Chat": "Нов чат",
"New Password": "Нова парола",
"No results found": "",
"No source available": "",
"No source available": "Няма наличен източник",
"Not factually correct": "",
"Not sure what to add?": "Не сте сигурни, какво да добавите?",
"Not sure what to write? Switch to": "Не сте сигурни, какво да напишете? Превключете към",
......@@ -407,7 +407,7 @@
"Sign Out": "Изход",
"Sign up": "Регистрация",
"Signing in": "",
"Source": "",
"Source": "Източник",
"Speech recognition error: {{error}}": "Speech recognition error: {{error}}",
"Speech-to-Text Engine": "Speech-to-Text Engine",
"SpeechRecognition API is not supported in this browser.": "SpeechRecognition API is not supported in this browser.",
......
......@@ -76,7 +76,7 @@
"Chunk Overlap": "চাঙ্ক ওভারল্যাপ",
"Chunk Params": "চাঙ্ক প্যারামিটার্স",
"Chunk Size": "চাঙ্ক সাইজ",
"Citation": "",
"Citation": "উদ্ধৃতি",
"Click here for help.": "সাহায্যের জন্য এখানে ক্লিক করুন",
"Click here to": "",
"Click here to check other modelfiles.": "অন্যান্য মডেলফাইল চেক করার জন্য এখানে ক্লিক করুন",
......@@ -285,7 +285,7 @@
"New Chat": "নতুন চ্যাট",
"New Password": "নতুন পাসওয়ার্ড",
"No results found": "",
"No source available": "",
"No source available": "কোন উৎস পাওয়া যায়নি",
"Not factually correct": "",
"Not sure what to add?": "কী যুক্ত করতে হবে নিশ্চিত না?",
"Not sure what to write? Switch to": "কী লিখতে হবে নিশ্চিত না? পরিবর্তন করুন:",
......@@ -407,7 +407,7 @@
"Sign Out": "সাইন আউট",
"Sign up": "সাইন আপ",
"Signing in": "",
"Source": "",
"Source": "উৎস",
"Speech recognition error: {{error}}": "স্পিচ রিকগনিশনে সমস্যা: {{error}}",
"Speech-to-Text Engine": "স্পিচ-টু-টেক্সট ইঞ্জিন",
"SpeechRecognition API is not supported in this browser.": "এই ব্রাউজার স্পিচরিকগনিশন এপিআই সাপোর্ট করে না।",
......
......@@ -76,7 +76,7 @@
"Chunk Overlap": "Solapament de Blocs",
"Chunk Params": "Paràmetres de Blocs",
"Chunk Size": "Mida del Bloc",
"Citation": "",
"Citation": "Citació",
"Click here for help.": "Fes clic aquí per ajuda.",
"Click here to": "",
"Click here to check other modelfiles.": "Fes clic aquí per comprovar altres fitxers de model.",
......@@ -285,7 +285,7 @@
"New Chat": "Xat Nou",
"New Password": "Nova Contrasenya",
"No results found": "",
"No source available": "",
"No source available": "Sense font disponible",
"Not factually correct": "",
"Not sure what to add?": "No estàs segur del que afegir?",
"Not sure what to write? Switch to": "No estàs segur del que escriure? Canvia a",
......@@ -407,7 +407,7 @@
"Sign Out": "Tanca sessió",
"Sign up": "Registra't",
"Signing in": "",
"Source": "",
"Source": "Font",
"Speech recognition error: {{error}}": "Error de reconeixement de veu: {{error}}",
"Speech-to-Text Engine": "Motor de Veu a Text",
"SpeechRecognition API is not supported in this browser.": "L'API de Reconèixer Veu no és compatible amb aquest navegador.",
......
......@@ -285,7 +285,7 @@
"New Chat": "New Bark",
"New Password": "New Barkword",
"No results found": "",
"No source available": "",
"No source available": "No source available",
"Not factually correct": "",
"Not sure what to add?": "Not sure what to add?",
"Not sure what to write? Switch to": "Not sure what to write? Switch to",
......@@ -407,7 +407,7 @@
"Sign Out": "Sign Out much logout",
"Sign up": "Sign up much join",
"Signing in": "",
"Source": "",
"Source": "Source",
"Speech recognition error: {{error}}": "Speech recognition error: {{error}} so error",
"Speech-to-Text Engine": "Speech-to-Text Engine much speak",
"SpeechRecognition API is not supported in this browser.": "SpeechRecognition API is not supported in this browser. Much sad.",
......
......@@ -76,7 +76,7 @@
"Chunk Overlap": "Superposición de fragmentos",
"Chunk Params": "Parámetros de fragmentos",
"Chunk Size": "Tamaño de fragmentos",
"Citation": "",
"Citation": "Cita",
"Click here for help.": "Presiona aquí para obtener ayuda.",
"Click here to": "",
"Click here to check other modelfiles.": "Presiona aquí para consultar otros modelfiles.",
......@@ -285,7 +285,7 @@
"New Chat": "Nuevo Chat",
"New Password": "Nueva Contraseña",
"No results found": "",
"No source available": "",
"No source available": "No hay fuente disponible",
"Not factually correct": "",
"Not sure what to add?": "¿No sabes qué añadir?",
"Not sure what to write? Switch to": "¿No sabes qué escribir? Cambia a",
......@@ -407,7 +407,7 @@
"Sign Out": "Cerrar sesión",
"Sign up": "Crear una cuenta",
"Signing in": "",
"Source": "",
"Source": "Fuente",
"Speech recognition error: {{error}}": "Error de reconocimiento de voz: {{error}}",
"Speech-to-Text Engine": "Motor de voz a texto",
"SpeechRecognition API is not supported in this browser.": "La API SpeechRecognition no es compatible con este navegador.",
......
......@@ -76,7 +76,7 @@
"Chunk Overlap": "همپوشانی تکه",
"Chunk Params": "پارامترهای تکه",
"Chunk Size": "اندازه تکه",
"Citation": "",
"Citation": "استناد",
"Click here for help.": "برای کمک اینجا را کلیک کنید.",
"Click here to": "",
"Click here to check other modelfiles.": "برای بررسی سایر فایل\u200cهای مدل اینجا را کلیک کنید.",
......@@ -285,7 +285,7 @@
"New Chat": "گپ جدید",
"New Password": "رمز عبور جدید",
"No results found": "",
"No source available": "",
"No source available": "منبعی در دسترس نیست",
"Not factually correct": "",
"Not sure what to add?": "مطمئن نیستید چه چیزی را اضافه کنید؟",
"Not sure what to write? Switch to": "مطمئن نیستید چه بنویسید؟ تغییر به",
......@@ -407,7 +407,7 @@
"Sign Out": "خروج",
"Sign up": "ثبت نام",
"Signing in": "",
"Source": "",
"Source": "منبع",
"Speech recognition error: {{error}}": "خطای تشخیص گفتار: {{error}}",
"Speech-to-Text Engine": "موتور گفتار به متن",
"SpeechRecognition API is not supported in this browser.": "API تشخیص گفتار در این مرورگر پشتیبانی نمی شود.",
......
......@@ -76,7 +76,7 @@
"Chunk Overlap": "Chevauchement de bloc",
"Chunk Params": "Paramètres de bloc",
"Chunk Size": "Taille de bloc",
"Citation": "",
"Citation": "Citations",
"Click here for help.": "Cliquez ici pour de l'aide.",
"Click here to": "",
"Click here to check other modelfiles.": "Cliquez ici pour vérifier d'autres fichiers de modèle.",
......@@ -285,7 +285,7 @@
"New Chat": "Nouvelle discussion",
"New Password": "Nouveau mot de passe",
"No results found": "",
"No source available": "",
"No source available": "Aucune source disponible",
"Not factually correct": "",
"Not sure what to add?": "Pas sûr de quoi ajouter ?",
"Not sure what to write? Switch to": "Pas sûr de quoi écrire ? Changez pour",
......@@ -407,7 +407,7 @@
"Sign Out": "Se déconnecter",
"Sign up": "S'inscrire",
"Signing in": "",
"Source": "",
"Source": "Source",
"Speech recognition error: {{error}}": "Erreur de reconnaissance vocale : {{error}}",
"Speech-to-Text Engine": "Moteur reconnaissance vocale",
"SpeechRecognition API is not supported in this browser.": "L'API SpeechRecognition n'est pas prise en charge dans ce navigateur.",
......
......@@ -76,7 +76,7 @@
"Chunk Overlap": "Chevauchement de bloc",
"Chunk Params": "Paramètres de bloc",
"Chunk Size": "Taille de bloc",
"Citation": "",
"Citation": "Citations",
"Click here for help.": "Cliquez ici pour de l'aide.",
"Click here to": "",
"Click here to check other modelfiles.": "Cliquez ici pour vérifier d'autres fichiers de modèle.",
......@@ -285,7 +285,7 @@
"New Chat": "Nouveau chat",
"New Password": "Nouveau mot de passe",
"No results found": "",
"No source available": "",
"No source available": "Aucune source disponible",
"Not factually correct": "",
"Not sure what to add?": "Vous ne savez pas quoi ajouter ?",
"Not sure what to write? Switch to": "Vous ne savez pas quoi écrire ? Basculer vers",
......@@ -407,7 +407,7 @@
"Sign Out": "Se déconnecter",
"Sign up": "S'inscrire",
"Signing in": "",
"Source": "",
"Source": "Source",
"Speech recognition error: {{error}}": "Erreur de reconnaissance vocale : {{error}}",
"Speech-to-Text Engine": "Moteur de reconnaissance vocale",
"SpeechRecognition API is not supported in this browser.": "L'API SpeechRecognition n'est pas prise en charge dans ce navigateur.",
......
......@@ -76,7 +76,7 @@
"Chunk Overlap": "चंक ओवरलैप",
"Chunk Params": "चंक पैरामीटर्स",
"Chunk Size": "चंक आकार",
"Citation": "",
"Citation": "उद्धरण",
"Click here for help.": "सहायता के लिए यहां क्लिक करें।",
"Click here to": "",
"Click here to check other modelfiles.": "अन्य मॉडल फ़ाइलों की जांच के लिए यहां क्लिक करें।",
......@@ -285,7 +285,7 @@
"New Chat": "नई चैट",
"New Password": "नया पासवर्ड",
"No results found": "",
"No source available": "",
"No source available": "कोई स्रोत उपलब्ध नहीं है",
"Not factually correct": "तथ्यात्मक रूप से सही नहीं है",
"Not sure what to add?": "निश्चित नहीं कि क्या जोड़ें?",
"Not sure what to write? Switch to": "मैं आश्वस्त नहीं हूं कि क्या लिखना है? स्विच करें",
......@@ -407,7 +407,7 @@
"Sign Out": "साइन आउट",
"Sign up": "साइन अप",
"Signing in": "साइन इन हो रहा है",
"Source": "",
"Source": "स्रोत",
"Speech recognition error: {{error}}": "वाक् पहचान त्रुटि: {{error}}",
"Speech-to-Text Engine": "वाक्-से-पाठ इंजन",
"SpeechRecognition API is not supported in this browser.": "इस ब्राउज़र में SpeechRecognition API समर्थित नहीं है",
......
......@@ -76,7 +76,7 @@
"Chunk Overlap": "Sovrapposizione chunk",
"Chunk Params": "Parametri chunk",
"Chunk Size": "Dimensione chunk",
"Citation": "",
"Citation": "Citazione",
"Click here for help.": "Clicca qui per aiuto.",
"Click here to": "",
"Click here to check other modelfiles.": "Clicca qui per controllare altri file modello.",
......@@ -285,7 +285,7 @@
"New Chat": "Nuova chat",
"New Password": "Nuova password",
"No results found": "",
"No source available": "",
"No source available": "Nessuna fonte disponibile",
"Not factually correct": "",
"Not sure what to add?": "Non sei sicuro di cosa aggiungere?",
"Not sure what to write? Switch to": "Non sei sicuro di cosa scrivere? Passa a",
......@@ -407,7 +407,7 @@
"Sign Out": "Esci",
"Sign up": "Registrati",
"Signing in": "",
"Source": "",
"Source": "Fonte",
"Speech recognition error: {{error}}": "Errore di riconoscimento vocale: {{error}}",
"Speech-to-Text Engine": "Motore da voce a testo",
"SpeechRecognition API is not supported in this browser.": "L'API SpeechRecognition non è supportata in questo browser.",
......
......@@ -76,7 +76,7 @@
"Chunk Overlap": "チャンクオーバーラップ",
"Chunk Params": "チャンクパラメーター",
"Chunk Size": "チャンクサイズ",
"Citation": "",
"Citation": "引用文",
"Click here for help.": "ヘルプについてはここをクリックしてください。",
"Click here to": "",
"Click here to check other modelfiles.": "他のモデルファイルを確認するにはここをクリックしてください。",
......@@ -285,7 +285,7 @@
"New Chat": "新しいチャット",
"New Password": "新しいパスワード",
"No results found": "",
"No source available": "",
"No source available": "使用可能なソースがありません",
"Not factually correct": "",
"Not sure what to add?": "何を追加すればよいかわからない?",
"Not sure what to write? Switch to": "何を書けばよいかわからない? 次に切り替える",
......@@ -407,7 +407,7 @@
"Sign Out": "サインアウト",
"Sign up": "サインアップ",
"Signing in": "",
"Source": "",
"Source": "ソース",
"Speech recognition error: {{error}}": "音声認識エラー: {{error}}",
"Speech-to-Text Engine": "音声テキスト変換エンジン",
"SpeechRecognition API is not supported in this browser.": "このブラウザでは SpeechRecognition API がサポートされていません。",
......
......@@ -76,7 +76,7 @@
"Chunk Overlap": "გადახურვა ფრაგმენტულია",
"Chunk Params": "გადახურვის პარამეტრები",
"Chunk Size": "გადახურვის ზომა",
"Citation": "",
"Citation": "ციტატა",
"Click here for help.": "დახმარებისთვის, დააკლიკე აქ",
"Click here to": "",
"Click here to check other modelfiles.": "სხვა მოდელური ფაილების სანახავად, დააკლიკე აქ",
......@@ -285,7 +285,7 @@
"New Chat": "ახალი მიმოწერა",
"New Password": "ახალი პაროლი",
"No results found": "",
"No source available": "",
"No source available": "წყარო არ არის ხელმისაწვდომი",
"Not factually correct": "",
"Not sure what to add?": "არ იცი რა დაამატო?",
"Not sure what to write? Switch to": "არ იცი რა დაწერო? გადართვა:",
......@@ -407,7 +407,7 @@
"Sign Out": "გასვლა",
"Sign up": "რეგისტრაცია",
"Signing in": "",
"Source": "",
"Source": "წყარო",
"Speech recognition error: {{error}}": "მეტყველების ამოცნობის შეცდომა: {{error}}",
"Speech-to-Text Engine": "ხმოვან-ტექსტური ძრავი",
"SpeechRecognition API is not supported in this browser.": "მეტყველების ამოცნობის API არ არის მხარდაჭერილი ამ ბრაუზერში.",
......
......@@ -76,7 +76,7 @@
"Chunk Overlap": "Chunk Overlap",
"Chunk Params": "Chunk Params",
"Chunk Size": "Chunk Size",
"Citation": "",
"Citation": "인용",
"Click here for help.": "도움말을 보려면 여기를 클릭하세요.",
"Click here to": "",
"Click here to check other modelfiles.": "다른 모델파일을 확인하려면 여기를 클릭하세요.",
......@@ -285,7 +285,7 @@
"New Chat": "새 채팅",
"New Password": "새 비밀번호",
"No results found": "",
"No source available": "",
"No source available": "사용 가능한 소스 없음",
"Not factually correct": "",
"Not sure what to add?": "추가할 것이 궁금하세요?",
"Not sure what to write? Switch to": "무엇을 쓸지 모르겠나요? 전환하세요.",
......@@ -407,7 +407,7 @@
"Sign Out": "로그아웃",
"Sign up": "가입",
"Signing in": "",
"Source": "",
"Source": "출처",
"Speech recognition error: {{error}}": "음성 인식 오류: {{error}}",
"Speech-to-Text Engine": "음성-텍스트 엔진",
"SpeechRecognition API is not supported in this browser.": "이 브라우저에서는 SpeechRecognition API를 지원하지 않습니다.",
......
This diff is collapsed.
......@@ -76,8 +76,8 @@
"Chunk Overlap": "Chunk Overlap",
"Chunk Params": "Chunk Params",
"Chunk Size": "Chunk Grootte",
"Citation": "",
"Click here for help.": "Klik hier voor help.",
"Citation": "Citaat",
"Click here for help.": "Klik hier voor hulp.",
"Click here to": "",
"Click here to check other modelfiles.": "Klik hier om andere modelfiles te controleren.",
"Click here to select": "Klik hier om te selecteren",
......@@ -285,7 +285,7 @@
"New Chat": "Nieuwe Chat",
"New Password": "Nieuw Wachtwoord",
"No results found": "",
"No source available": "",
"No source available": "Geen bron beschikbaar",
"Not factually correct": "",
"Not sure what to add?": "Niet zeker wat toe te voegen?",
"Not sure what to write? Switch to": "Niet zeker wat te schrijven? Schakel over naar",
......@@ -407,7 +407,7 @@
"Sign Out": "Uitloggen",
"Sign up": "Registreren",
"Signing in": "",
"Source": "",
"Source": "Bron",
"Speech recognition error: {{error}}": "Spraakherkenning fout: {{error}}",
"Speech-to-Text Engine": "Spraak-naar-tekst Engine",
"SpeechRecognition API is not supported in this browser.": "SpeechRecognition API wordt niet ondersteund in deze browser.",
......
......@@ -76,7 +76,7 @@
"Chunk Overlap": "Zachodzenie bloku",
"Chunk Params": "Parametry bloku",
"Chunk Size": "Rozmiar bloku",
"Citation": "",
"Citation": "Cytat",
"Click here for help.": "Kliknij tutaj, aby uzyskać pomoc.",
"Click here to": "",
"Click here to check other modelfiles.": "Kliknij tutaj, aby sprawdzić inne pliki modelowe.",
......@@ -285,7 +285,7 @@
"New Chat": "Nowy czat",
"New Password": "Nowe hasło",
"No results found": "",
"No source available": "",
"No source available": "Brak dostępnego źródła",
"Not factually correct": "",
"Not sure what to add?": "Nie wiesz, co dodać?",
"Not sure what to write? Switch to": "Nie wiesz, co napisać? Przełącz się na",
......@@ -407,7 +407,7 @@
"Sign Out": "Wyloguj się",
"Sign up": "Zarejestruj się",
"Signing in": "",
"Source": "",
"Source": "Źródło",
"Speech recognition error: {{error}}": "Błąd rozpoznawania mowy: {{error}}",
"Speech-to-Text Engine": "Silnik mowy na tekst",
"SpeechRecognition API is not supported in this browser.": "API Rozpoznawania Mowy nie jest obsługiwane w tej przeglądarce.",
......
......@@ -76,7 +76,7 @@
"Chunk Overlap": "Sobreposição de Fragmento",
"Chunk Params": "Parâmetros de Fragmento",
"Chunk Size": "Tamanho do Fragmento",
"Citation": "",
"Citation": "Citação",
"Click here for help.": "Clique aqui para obter ajuda.",
"Click here to": "",
"Click here to check other modelfiles.": "Clique aqui para verificar outros arquivos de modelo.",
......@@ -285,7 +285,7 @@
"New Chat": "Novo Bate-papo",
"New Password": "Nova Senha",
"No results found": "",
"No source available": "",
"No source available": "Nenhuma fonte disponível",
"Not factually correct": "",
"Not sure what to add?": "Não tem certeza do que adicionar?",
"Not sure what to write? Switch to": "Não tem certeza do que escrever? Mude para",
......@@ -407,7 +407,7 @@
"Sign Out": "Sair",
"Sign up": "Inscrever-se",
"Signing in": "",
"Source": "",
"Source": "Fonte",
"Speech recognition error: {{error}}": "Erro de reconhecimento de fala: {{error}}",
"Speech-to-Text Engine": "Mecanismo de Fala para Texto",
"SpeechRecognition API is not supported in this browser.": "A API SpeechRecognition não é suportada neste navegador.",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment