This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| location / { | |
| proxy_pass http://0.0.0.0:8501/; | |
| proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
| proxy_set_header Host $http_host; | |
| proxy_redirect off; | |
| proxy_http_version 1.1; | |
| proxy_set_header Upgrade $http_upgrade; | |
| proxy_set_header Connection "upgrade"; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import asyncio | |
| import json | |
| import logging | |
| from typing import Any, Dict, Optional | |
| import modal | |
| from fastapi import FastAPI, Request | |
| from fastapi.responses import JSONResponse, StreamingResponse, Response | |
| from pydantic import BaseModel | |
| # Modal app configuration |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import asyncio | |
| import os | |
| import sys | |
| import re | |
| from pathlib import Path | |
| from urllib.parse import urlparse, parse_qs | |
| import aiohttp | |
| import aiofiles | |
| from typing import Any, Sequence | |
| import logging |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import base64 | |
| import requests | |
| # Set up Datasaur API | |
| API_URL = "https://deployment.datasaur.ai/api/deployment/8/1937/chat/completions" | |
| headers = { | |
| 'Authorization': 'Bearer <api-key>', | |
| 'Content-Type': 'application/json' | |
| } |
OlderNewer