davidna22 commited on
Commit
08e6713
·
1 Parent(s): 60e60fb

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -4
app.py CHANGED
@@ -44,11 +44,16 @@ def init_app(api_key,
44
  tootbot_app = TootBot(model=model_name,
45
  model_class=model_class,
46
  temperature=temperature)
47
- tootbot_app.mastodon_login(username="research-team@bot-simulation-research.app",
48
- password="DavidSamYungjun",
 
 
 
49
  redirect_uri="http://localhost:8080",
50
- client_id="mastodon/clientcred.secret",
51
- to_file="mastodon/usercred.secret")
 
 
52
  os.environ["OPENAI_API_KEY"] = api_key
53
  os.environ["OPENAI_API_KEY_2"] = api_key
54
  tootbot_app.init_models(diffusion_model=diffusion_model,
 
44
  tootbot_app = TootBot(model=model_name,
45
  model_class=model_class,
46
  temperature=temperature)
47
+ with open("client_cred.secret", "w") as file:
48
+ file.write(os.getenv("MASTODON_CLIENT_SECRET"))
49
+ file.close()
50
+ tootbot_app.mastodon_login(username=os.getenv("MASTODON_USERNAME"),
51
+ password=os.getenv("MASTODON_PASSWORD"),
52
  redirect_uri="http://localhost:8080",
53
+ client_id="client_cred.secret",
54
+ to_file="usercred.secret")
55
+ os.remove("usercred.secret")
56
+ os.remove("client_cred.secret")
57
  os.environ["OPENAI_API_KEY"] = api_key
58
  os.environ["OPENAI_API_KEY_2"] = api_key
59
  tootbot_app.init_models(diffusion_model=diffusion_model,