Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -12,6 +12,26 @@ from langchain_community.embeddings import HuggingFaceEmbeddings
|
|
| 12 |
from llama_parse import LlamaParse
|
| 13 |
import gradio as gr
|
| 14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
# Initialize LlamaParse
|
| 16 |
llama_parser = LlamaParse(
|
| 17 |
api_key=llama_cloud_api_key,
|
|
|
|
| 12 |
from llama_parse import LlamaParse
|
| 13 |
import gradio as gr
|
| 14 |
|
| 15 |
+
# Set up basic configuration for logging
|
| 16 |
+
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
|
| 17 |
+
|
| 18 |
+
# Environment variables and configurations
|
| 19 |
+
huggingface_token = os.environ.get("HUGGINGFACE_TOKEN")
|
| 20 |
+
llama_cloud_api_key = os.environ.get("LLAMA_CLOUD_API_KEY")
|
| 21 |
+
ACCOUNT_ID = os.environ.get("CLOUDFARE_ACCOUNT_ID")
|
| 22 |
+
API_TOKEN = os.environ.get("CLOUDFLARE_AUTH_TOKEN")
|
| 23 |
+
API_BASE_URL = "https://api.cloudflare.com/client/v4/accounts/a17f03e0f049ccae0c15cdcf3b9737ce/ai/run/"
|
| 24 |
+
|
| 25 |
+
print(f"ACCOUNT_ID: {ACCOUNT_ID}")
|
| 26 |
+
print(f"CLOUDFLARE_AUTH_TOKEN: {API_TOKEN[:5]}..." if API_TOKEN else "Not set")
|
| 27 |
+
|
| 28 |
+
MODELS = [
|
| 29 |
+
"mistralai/Mistral-7B-Instruct-v0.3",
|
| 30 |
+
"mistralai/Mixtral-8x7B-Instruct-v0.1",
|
| 31 |
+
"@cf/meta/llama-3.1-8b-instruct",
|
| 32 |
+
"mistralai/Mistral-Nemo-Instruct-2407"
|
| 33 |
+
]
|
| 34 |
+
|
| 35 |
# Initialize LlamaParse
|
| 36 |
llama_parser = LlamaParse(
|
| 37 |
api_key=llama_cloud_api_key,
|