cahya commited on
Commit
bf32a4d
1 Parent(s): 96d6edd

update url path

Browse files
Files changed (2) hide show
  1. app/api.py +3 -3
  2. default +1 -1
app/api.py CHANGED
@@ -51,7 +51,7 @@ async def get():
51
  return HTMLResponse(html)
52
 
53
 
54
- @app.get("/env")
55
  async def env():
56
  environment_variables = "<h3>Environment Variables</h3>"
57
  for name, value in os.environ.items():
@@ -59,7 +59,7 @@ async def env():
59
  return HTMLResponse(environment_variables)
60
 
61
 
62
- @app.websocket("/ws")
63
  async def websocket_endpoint(websocket: WebSocket):
64
  await websocket.accept()
65
  while True:
@@ -112,7 +112,7 @@ async def indochat(
112
  time_end = time.time()
113
  time_diff = time_end - time_start
114
  print(f"result:\n{result}")
115
- generated_text = result
116
  return {"generated_text": generated_text, "processing_time": time_diff}
117
 
118
 
 
51
  return HTMLResponse(html)
52
 
53
 
54
+ @app.get("/api/env")
55
  async def env():
56
  environment_variables = "<h3>Environment Variables</h3>"
57
  for name, value in os.environ.items():
 
59
  return HTMLResponse(environment_variables)
60
 
61
 
62
+ @app.websocket("/api/ws")
63
  async def websocket_endpoint(websocket: WebSocket):
64
  await websocket.accept()
65
  while True:
 
112
  time_end = time.time()
113
  time_diff = time_end - time_start
114
  print(f"result:\n{result}")
115
+ generated_text = result[len(prompt):]
116
  return {"generated_text": generated_text, "processing_time": time_diff}
117
 
118
 
default CHANGED
@@ -54,7 +54,7 @@ server {
54
  location /api/ {
55
  proxy_set_header Host $host;
56
  proxy_set_header X-Real-IP $remote_addr;
57
- proxy_pass http://localhost:7880/;
58
 
59
  proxy_http_version 1.1;
60
  proxy_set_header Upgrade $http_upgrade;
 
54
  location /api/ {
55
  proxy_set_header Host $host;
56
  proxy_set_header X-Real-IP $remote_addr;
57
+ proxy_pass http://localhost:7880/api/;
58
 
59
  proxy_http_version 1.1;
60
  proxy_set_header Upgrade $http_upgrade;