Kvikontent commited on
Commit
ff147c7
·
verified ·
1 Parent(s): fdfe19c

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -0
app.py ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from huggingface_hub import InferenceClient
3
+ import spaces
4
+
5
+ client = InferenceClient("meta-llama/Meta-Llama-3-70B-Instruct")
6
+ messages=[]
7
+ client.chat_completion(messages, max_tokens=1024)
8
+
9
+ @spaces.GPU()
10
+ def respond(prompt):
11
+ response = client.chat_completion(
12
+ model="meta-llama/Meta-Llama-3-70B-Instruct",
13
+ messages=messages,
14
+ max_tokens=500,
15
+ )
16
+ return response.content
17
+
18
+ gr.ChatInterface(respond).launch()