willn9 commited on
Commit
884bc6d
·
verified ·
1 Parent(s): df82699

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -7
app.py CHANGED
@@ -1,13 +1,10 @@
1
- # Import necessary packages
2
- import os
3
  from ibm_watson_machine_learning.foundation_models import Model
4
  from ibm_watson_machine_learning.metanames import GenTextParamsMetaNames as GenParams
5
  from ibm_watson_machine_learning.foundation_models.utils.enums import ModelTypes, DecodingMethods
6
- import gradio as gr
7
 
8
- # Securely access the API key and project ID from environment variables
9
- watsonx_API = os.getenv("WATSONX_API")
10
- project_id = os.getenv("PROJECT_ID")
11
 
12
  generate_params = {
13
  GenParams.MAX_NEW_TOKENS: 250
@@ -27,4 +24,3 @@ q = "How to be happy?"
27
  generated_response = model.generate(prompt=q)
28
  print(generated_response['results'][0]['generated_text'])
29
 
30
-
 
 
 
1
  from ibm_watson_machine_learning.foundation_models import Model
2
  from ibm_watson_machine_learning.metanames import GenTextParamsMetaNames as GenParams
3
  from ibm_watson_machine_learning.foundation_models.utils.enums import ModelTypes, DecodingMethods
 
4
 
5
+ # Set up the API key and project ID for IBM Watson
6
+ watsonx_API = "Q7fLgZsmjZJ9L8BhLE_asx91M1C3dlPeYgmSm2wBleyk" # below is the instruction how to get them
7
+ project_id= "a5a13c69-59c8-4856-bea6-4fa1f85e2cbb" # like "0blahblah-000-9999-blah-99bla0hblah0"
8
 
9
  generate_params = {
10
  GenParams.MAX_NEW_TOKENS: 250
 
24
  generated_response = model.generate(prompt=q)
25
  print(generated_response['results'][0]['generated_text'])
26