mmsellam commited on
Commit
19f7dac
·
verified ·
1 Parent(s): 1a0e67f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -1,6 +1,11 @@
1
  import gradio as gr
2
  from huggingface_hub import InferenceClient
3
 
 
 
 
 
 
4
 
5
  def respond(
6
  message,
@@ -14,7 +19,8 @@ def respond(
14
  """
15
  For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
16
  """
17
- client = InferenceClient(token=hf_token.token, model="openai/gpt-oss-20b")
 
18
 
19
  messages = [{"role": "system", "content": system_message}]
20
 
@@ -67,4 +73,4 @@ with gr.Blocks() as demo:
67
 
68
 
69
  if __name__ == "__main__":
70
- demo.launch()
 
1
  import gradio as gr
2
  from huggingface_hub import InferenceClient
3
 
4
+ ## NOTE: To use a token that bills to LauzHack cannot use OAuth tokens!
5
+ import os
6
+ HF_TOKEN = os.environ["HF_TOKEN"]
7
+ client = InferenceClient(token=HF_TOKEN, model="openai/gpt-oss-20b", bill_to="LauzHack")
8
+
9
 
10
  def respond(
11
  message,
 
19
  """
20
  For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
21
  """
22
+ # ### NOTE: `bill_to` cannot be used here as this is an OAuth tokens through logging in
23
+ # client = InferenceClient(token=hf_token.token, model="openai/gpt-oss-20b") # Bills to personal account
24
 
25
  messages = [{"role": "system", "content": system_message}]
26
 
 
73
 
74
 
75
  if __name__ == "__main__":
76
+ demo.launch()