Spaces:
Build error
Build error
Update app.py
Browse files1 unmodified line2345678910111213141516171 unmodified linefrom huggingface_hub import InferenceClient# Inicialize o cliente com o modelo do Hugging Faceclient = InferenceClient("ulisesbravo/autotrain-nsuej-5ctie")def classify_text(text):# Realize a inferência chamando o método __call__response = client(text) # Chame o cliente como uma função# Inspecione a resposta para entender a estruturaprint(response) # Para depuração# Extraia a classificação do responseif isinstance(response, list) and len(response) > 0:predicted_class = response[0]['label'] if 'label' in response[0] else "Classificação não encontrada"else:1 unmodified line2345678910111213141516171 unmodified linefrom huggingface_hub import InferenceClient# Inicialize o cliente com o modelo do Hugging Faceclient = InferenceClient(model="ulisesbravo/autotrain-nsuej-5ctie")def classify_text(text):# Realize a inferência chamando o método post ou queryresponse = client.post(json={"inputs": text}) # Use o método correto para enviar o texto# Inspecione a resposta para entender a estruturaprint(response) # Para depuração# Extraia a classificação da respostaif isinstance(response, list) and len(response) > 0:predicted_class = response[0]['label'] if 'label' in response[0] else "Classificação não encontrada"else:
app.py+4-4