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 os | |
| from morphcloud.api import MorphCloudClient | |
| from playwright.sync_api import sync_playwright | |
| from openai import OpenAI | |
| from pydantic import BaseModel | |
| from typing import Optional | |
| # -- init stuff | |
| os.environ.setdefault("BROWSERS_BASE_URL", "https://browsers.svc.cloud.morph.so") |
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 modal | |
| from typing import Optional | |
| import torch | |
| from transformers import AutoTokenizer, AutoModelForCausalLM | |
| app = modal.App("text-generation-api") | |
| image = ( | |
| modal.Image.debian_slim(python_version="3.11") | |
| .pip_install( |