AndreiFX commited on
Commit
6b8cd3c
·
1 Parent(s): 4be9ba0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -1,17 +1,17 @@
1
- API_URL = "https://api-inference.huggingface.co/models/tiiuae/falcon-7b-instruct"
2
-
3
  import os
4
- hf_api_key = os.environ["hf_api_key"]
5
-
6
  import gradio as gr
7
  import requests, json
8
  from text_generation import Client
9
 
 
 
 
 
10
  #FalcomLM-instruct endpoint on the text_generation library
11
  client = Client(API_URL, headers={"Authorization": f"Bearer {hf_api_key}"}, timeout=120)
12
 
13
  def generate(input):
14
- output = client.generate(f' Act as a dream interpreter and analyze dreams using the psychoanalytical approach. Elaborate on the different possible interpretation and use the psychological aspects. The dream: {input}', max_new_tokens = 500).generated_text
15
  return output
16
 
17
 
 
 
 
1
  import os
 
 
2
  import gradio as gr
3
  import requests, json
4
  from text_generation import Client
5
 
6
+ hf_api_key = os.environ["hf_api_key"]
7
+ API_URL = os.environ["API_URL"]
8
+ prompt = os.environ["prompt"]
9
+
10
  #FalcomLM-instruct endpoint on the text_generation library
11
  client = Client(API_URL, headers={"Authorization": f"Bearer {hf_api_key}"}, timeout=120)
12
 
13
  def generate(input):
14
+ output = client.generate(prompt, max_new_tokens = 500).generated_text
15
  return output
16
 
17