Spaces:
Sleeping
Sleeping
Upload 2 files
Browse files
app.py
CHANGED
@@ -1,7 +1,6 @@
|
|
1 |
import os
|
2 |
from fastapi import FastAPI, Header, HTTPException, Body
|
3 |
from transformers import AutoTokenizer
|
4 |
-
import gradio as gr
|
5 |
|
6 |
# 從環境變數讀取 secret
|
7 |
EXPECTED_API_KEY = os.environ.get("apikey")
|
@@ -31,9 +30,4 @@ async def tokenize(
|
|
31 |
|
32 |
tokens = tokenizer.tokenize(text)
|
33 |
return {"tokens": tokens}
|
34 |
-
|
35 |
-
with gr.Blocks() as demo:
|
36 |
-
print('boot')
|
37 |
-
|
38 |
-
if __name__ == "__main__":
|
39 |
-
demo.launch()
|
|
|
1 |
import os
|
2 |
from fastapi import FastAPI, Header, HTTPException, Body
|
3 |
from transformers import AutoTokenizer
|
|
|
4 |
|
5 |
# 從環境變數讀取 secret
|
6 |
EXPECTED_API_KEY = os.environ.get("apikey")
|
|
|
30 |
|
31 |
tokens = tokenizer.tokenize(text)
|
32 |
return {"tokens": tokens}
|
33 |
+
|
|
|
|
|
|
|
|
|
|