shangab commited on
Commit
bbe376b
1 Parent(s): 39311e7

Upload 2 files

Browse files
Files changed (2) hide show
  1. app.py +23 -0
  2. requirements.txt +2 -0
app.py ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import requests as rq
2
+ import streamlit as st
3
+ import os
4
+
5
+ API_URL = "https://api-inference.huggingface.co/models/meta-llama/Meta-Llama-3-8B"
6
+ HF_LLAMA3_TOKEN = os.getenv("HF_LLAMA3_TOKEN")
7
+ headers = {"Authorization": "Bearer " + HF_LLAMA3_TOKEN}
8
+
9
+
10
+ def query(payload):
11
+ response = rq.post(API_URL, headers=headers, json=payload)
12
+ return response.json()
13
+
14
+
15
+ st.title("LLama3 8B T")
16
+ st.subheader("This is a demo of the LLama3 8B T model.")
17
+
18
+ user_input = st.text_area("Enter your text here:")
19
+ if st.button("Submit"):
20
+ output = query({
21
+ "inputs": user_input,
22
+ })
23
+ st.write(output)
requirements.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ requests
2
+ streamlit