File size: 678 Bytes
23e4842
 
34addff
23e4842
 
 
83687a7
23e4842
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import torch
import gradio as gr
import os
from transformers import AlignProcessor, AlignModel
from transformers import AzureOpenAiAgent, OpenAiAgent

agent = OpenAiAgent(model="text-davinci-003", api_key=os.environ.get("openai_key"))



def predict(text):
    agent.run("Is the following `text` (in French) positive or negative?", text=text)


description = """
"""

gr.Interface(
    fn=predict,
    inputs=[
        gr.inputs.Textbox(lines=1, placeholder="Enter text",)
    ],
    theme="grass",
    outputs="label",
    examples=[
        ["My name is  Antoine",], 
    ],
    title="Images vs labels créé avec ALIGN et Huggingface",
    description=description
).launch()