Spaces:
Sleeping
Sleeping
Update main.py
Browse files324 unmodified lines325326327328329330331332333334335324 unmodified linesListaInput = await CreaListaInput(input_data)for data in ListaInput:LoggaTesto("RICHIESTA ASINCRONA", data)tasks.extend([make_request(session, token, data, url, index, semaphore) for index in range(input_data.NumeroGenerazioni)])await asyncio.sleep(0.1)return await asyncio.gather(*tasks)#--------------------------------------------------- Generazione IMMAGINE ------------------------------------------------------style_image = {"PROFESSIONAL-PHOTO": {324 unmodified lines325326327328329330331332333334335336337338339340341342343344345346324 unmodified linesListaInput = await CreaListaInput(input_data)for data in ListaInput:LoggaTesto("RICHIESTA ASINCRONA", data)#tasks.extend([make_request(session, token, data, url, index, semaphore) for index in range(input_data.NumeroGenerazioni)])tasks.extend([generate_text_internal(data) for _ in range(input_data.NumeroGenerazioni)])await asyncio.sleep(0.1)return await asyncio.gather(*tasks)async def generate_text_internal(data):temperature = data.temperaturemax_new_tokens = data.max_new_tokenstop_p = data.top_prepetition_penalty = data.repetition_penaltyinput_text = generate_input_text(data)max_new_tokens = min(max_new_tokens, 29500 - len(input_text))history = []generated_response = generate(input_text, history, temperature, max_new_tokens, top_p, repetition_penalty)return generated_response#--------------------------------------------------- Generazione IMMAGINE ------------------------------------------------------style_image = {"PROFESSIONAL-PHOTO": {
main.py+13-2