Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
@@ -13,7 +13,8 @@ from enum import Enum
|
|
13 |
import random
|
14 |
import aiohttp
|
15 |
import asyncio
|
16 |
-
import json
|
|
|
17 |
|
18 |
#--------------------------------------------------- Definizione Server FAST API ------------------------------------------------------
|
19 |
app = FastAPI()
|
@@ -330,7 +331,8 @@ async def GeneraTestoAsync(url, input_data):
|
|
330 |
await asyncio.sleep(0.1)
|
331 |
return await asyncio.gather(*tasks)
|
332 |
|
333 |
-
async def generate_text_internal(
|
|
|
334 |
temperature = data.temperature
|
335 |
max_new_tokens = data.max_new_tokens
|
336 |
top_p = data.top_p
|
|
|
13 |
import random
|
14 |
import aiohttp
|
15 |
import asyncio
|
16 |
+
import json
|
17 |
+
from types import SimpleNamespace
|
18 |
|
19 |
#--------------------------------------------------- Definizione Server FAST API ------------------------------------------------------
|
20 |
app = FastAPI()
|
|
|
331 |
await asyncio.sleep(0.1)
|
332 |
return await asyncio.gather(*tasks)
|
333 |
|
334 |
+
async def generate_text_internal(datajson):
|
335 |
+
data = SimpleNamespace(**datajson)
|
336 |
temperature = data.temperature
|
337 |
max_new_tokens = data.max_new_tokens
|
338 |
top_p = data.top_p
|