Snapshot
Browse files- .python-version +1 -0
- README.md +0 -0
- main.py +23 -0
- pyproject.toml +15 -0
- uv.lock +0 -0
.python-version
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
3.12
|
README.md
ADDED
File without changes
|
main.py
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from fastapi import FastAPI
|
2 |
+
from fastapi.staticfiles import StaticFiles
|
3 |
+
from pydantic import BaseModel
|
4 |
+
|
5 |
+
class Word(BaseModel):
|
6 |
+
word: str
|
7 |
+
start: int
|
8 |
+
end: int
|
9 |
+
logprob: float
|
10 |
+
suggestions: list[str]
|
11 |
+
|
12 |
+
class CheckResponse(BaseModel):
|
13 |
+
text: str
|
14 |
+
words: list[Word]
|
15 |
+
|
16 |
+
app = FastAPI()
|
17 |
+
|
18 |
+
@app.get("/check", response_model=CheckResponse)
|
19 |
+
def check(text: str):
|
20 |
+
return CheckResponse(text=text, words=[])
|
21 |
+
|
22 |
+
# serve files from frontend/public
|
23 |
+
app.mount("/", StaticFiles(directory="frontend/public", html=True))
|
pyproject.toml
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
[project]
|
2 |
+
name = "playground-gpted"
|
3 |
+
version = "0.1.0"
|
4 |
+
description = "Add your description here"
|
5 |
+
readme = "README.md"
|
6 |
+
requires-python = ">=3.12"
|
7 |
+
dependencies = [
|
8 |
+
"fastapi[standard]>=0.115.2",
|
9 |
+
"huggingface-hub>=0.25.2",
|
10 |
+
"ipykernel>=6.29.5",
|
11 |
+
"ipywidgets>=8.1.5",
|
12 |
+
"openai>=1.51.2",
|
13 |
+
"torch>=2.4.1",
|
14 |
+
"transformers>=4.45.2",
|
15 |
+
]
|
uv.lock
ADDED
The diff for this file is too large to render.
See raw diff
|
|