kenken999 commited on
Commit
91dd5bc
·
1 Parent(s): d61a99c
Files changed (4) hide show
  1. chat_history.db +1 -1
  2. requirements.txt +1 -1
  3. routers/gradio.py +35 -0
  4. workspace/test.py +0 -1
chat_history.db CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:122bfb45b265b198249f0b4990261603b72de859cfa5989e193cca9955b5a8ba
3
  size 1859584
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8eef105e14f8585afdcba2ae180f9cfc9325855c98ae62aeac7a65199ddfdf10
3
  size 1859584
requirements.txt CHANGED
@@ -63,4 +63,4 @@ google-auth-oauthlib
63
  google-auth-httplib2
64
  google-api-python-client
65
  line-bot-sdk
66
-
 
63
  google-auth-httplib2
64
  google-api-python-client
65
  line-bot-sdk
66
+ gradio_client
routers/gradio.py ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import requests
2
+ import json
3
+ import os
4
+ # current_user: User = Depends(get_current_active_user)):
5
+ # oauth2_scheme = OAuth2PasswordBearer(tokenUrl="/token")
6
+ # current_user: User = Depends(get_current_active_user)):
7
+ # oauth2_scheme = OAuth2PasswordBearer(tokenUrl="/token")
8
+
9
+ from fastapi import APIRouter, HTTPException
10
+ from gradio_client import Client
11
+
12
+ #router = APIRouter()
13
+ router = APIRouter(prefix="/gradio", tags=["gradio"])
14
+ @router.get("/route/gradio")
15
+
16
+ def get_senario(id,res):
17
+ table = "LOG"
18
+
19
+ client = Client("kenken999/fastapi_django_main_live")
20
+ result = client.predict(
21
+ message="Hello!!",
22
+ request=0.95,
23
+ param_3=512,
24
+ api_name="/chat"
25
+ )
26
+ print(result)
27
+
28
+ # main input
29
+ #res = get_senario("LOG")
30
+ #print(res)
31
+ #return res
32
+
33
+ #print(response.json())
34
+ if __name__ == "__main__":
35
+ get_senario("test","test")
workspace/test.py CHANGED
@@ -1 +0,0 @@
1
- print('Hello, World!')