File size: 531 Bytes
c1cb739
 
b281795
 
 
 
e23d341
 
 
c1cb739
 
 
 
 
86226b8
 
 
c1cb739
 
86226b8
c1cb739
b281795
86226b8
c1cb739
 
 
 
 
 
86226b8
 
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
31
32
import gradio as gr

import os

api_key = os.getenv("TOKEN")

from huggingface_hub import login
login()

def greet(name):
    return "Hello " + name + "!!"

from huggingface_hub import InferenceClient


# Use a pipeline as a high-level helper
from transformers import pipeline

messages = [
    {"role": "user", "content": "Who are you?"},
]
pipe = pipeline("text-generation", model="meta-llama/Llama-3.1-8B-Instruct",token=api_key)
pipe(messages)






#demo = gr.Interface(fn=greet, inputs="text", outputs="text")
#demo.launch()