Spaces:
Running
Running
Update gen.py
Browse files
gen.py
CHANGED
|
@@ -7,7 +7,7 @@ from fastapi import APIRouter, Request, HTTPException, Header
|
|
| 7 |
from fastapi.responses import Response, JSONResponse, StreamingResponse
|
| 8 |
import re
|
| 9 |
from typing import Optional
|
| 10 |
-
|
| 11 |
from helper.assets import (
|
| 12 |
save_base64_image,
|
| 13 |
cleanup_image,
|
|
@@ -771,7 +771,7 @@ async def generate_text(
|
|
| 771 |
async for chunk, model_used in stream_primary(client, url, body, headers):
|
| 772 |
|
| 773 |
if not sent_metadata:
|
| 774 |
-
actual_model = model_used
|
| 775 |
meta = {
|
| 776 |
"router_metadata": {
|
| 777 |
"model_name": MODEL_MAP.get(actual_model, actual_model)
|
|
|
|
| 7 |
from fastapi.responses import Response, JSONResponse, StreamingResponse
|
| 8 |
import re
|
| 9 |
from typing import Optional
|
| 10 |
+
import json
|
| 11 |
from helper.assets import (
|
| 12 |
save_base64_image,
|
| 13 |
cleanup_image,
|
|
|
|
| 771 |
async for chunk, model_used in stream_primary(client, url, body, headers):
|
| 772 |
|
| 773 |
if not sent_metadata:
|
| 774 |
+
actual_model = MODEL_MAP[model_used]
|
| 775 |
meta = {
|
| 776 |
"router_metadata": {
|
| 777 |
"model_name": MODEL_MAP.get(actual_model, actual_model)
|