supernovamutinda commited on
Commit
b3886de
β€’
1 Parent(s): 5c53b58

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -7
app.py CHANGED
@@ -3,6 +3,7 @@ import time
3
  import pandas as pd
4
  import numpy as np
5
  import torch
 
6
  from transformers import pipeline
7
 
8
  st.set_page_config(page_title="Samuel Portfolio", page_icon="πŸ“ˆ")
@@ -87,14 +88,18 @@ if choice == "Plotting":
87
  st.button("Re-run")
88
 
89
  if choice == "Contact":
90
- st.title("You can contact me via:")
91
-
92
- torch.manual_seed(0)
93
- generator = pipeline('text-generation', model = 'gpt2')
94
- prompt = "Hello, I'm a language model"
95
 
96
- generator(prompt, max_length = 30)
97
- st.write(generator)
 
 
 
 
 
98
 
99
  if choice == "Attached files":
100
  st.title("Download final project report here")
 
3
  import pandas as pd
4
  import numpy as np
5
  import torch
6
+ import requests
7
  from transformers import pipeline
8
 
9
  st.set_page_config(page_title="Samuel Portfolio", page_icon="πŸ“ˆ")
 
88
  st.button("Re-run")
89
 
90
  if choice == "Contact":
91
+ st.title("You can contact me via:")
92
+
93
+ API_URL = "https://api-inference.huggingface.co/models/HuggingFaceH4/zephyr-7b-beta"
94
+ headers = {"Authorization": "Bearer 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"}
 
95
 
96
+ def query(payload):
97
+ response = requests.post(API_URL, headers=headers, json=payload)
98
+ return response.json()
99
+
100
+ output = query({
101
+ "inputs": "Can you please let us know more details about your ",
102
+ })
103
 
104
  if choice == "Attached files":
105
  st.title("Download final project report here")