arhamTariq commited on
Commit
490dd4d
·
verified ·
1 Parent(s): 9259385

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -6
app.py CHANGED
@@ -4,15 +4,13 @@ from huggingface_hub import InferenceClient
4
  api_token = os.environ.get("HUGGINGFACEHUB_API_TOKEN")
5
 
6
  client = InferenceClient(
7
- model="mistralai/Mistral-7B-Instruct-v0.2", # Example chat model
8
  token=api_token
9
  )
10
 
11
  prompt = "Hello world"
12
 
13
- # For chat models
14
- response = client.chat_completion(
15
- messages=[{"role": "user", "content": prompt}]
16
- )
17
 
18
- print(response.choices[0].message.content)
 
4
  api_token = os.environ.get("HUGGINGFACEHUB_API_TOKEN")
5
 
6
  client = InferenceClient(
7
+ model="google/flan-t5-large",
8
  token=api_token
9
  )
10
 
11
  prompt = "Hello world"
12
 
13
+ # Use text generation method instead
14
+ response = client.text_generation(prompt)
 
 
15
 
16
+ print(response)