anteaterho commited on
Commit
c7bd072
β€’
1 Parent(s): 0501d0a

remove openai module

Browse files
Files changed (1) hide show
  1. app.py +0 -25
app.py CHANGED
@@ -1,5 +1,4 @@
1
  import gradio as gr
2
- import openai
3
  import re
4
  import datetime
5
 
@@ -11,8 +10,6 @@ import random
11
 
12
  # token for SDXL
13
  access_token="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"
14
- # token for OpenAI
15
- openai.api_key = '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'
16
 
17
  # output path
18
  path = "./output"
@@ -23,28 +20,6 @@ messages=[{
23
  'content' : 'You are a helpful assistant for organizing prompt for generating images'
24
  }]
25
 
26
- def translate(msg):
27
- messages.append({
28
- 'role' : 'assistant',
29
- 'content' : msg
30
- })
31
-
32
- messages.append({
33
- 'role' : 'user',
34
- 'content' : 'Translate the sentence into English only. Keep the symbols intact when translating.'
35
- })
36
-
37
- res = openai.ChatCompletion.create(
38
- model='gpt-3.5-turbo',
39
- messages=messages
40
- )
41
-
42
- _msg = res['choices'][0]['message']['content']
43
-
44
- print(_msg)
45
-
46
- return _msg
47
-
48
  # mBart settings
49
  article_kr = "μœ μ—”μ˜ λŒ€ν‘œλŠ” μ‹œλ¦¬μ•„μ— ꡰ사적인 해결책이 μ—†λ‹€κ³  λ§ν•©λ‹ˆλ‹€." #example article
50
 
 
1
  import gradio as gr
 
2
  import re
3
  import datetime
4
 
 
10
 
11
  # token for SDXL
12
  access_token="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"
 
 
13
 
14
  # output path
15
  path = "./output"
 
20
  'content' : 'You are a helpful assistant for organizing prompt for generating images'
21
  }]
22
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  # mBart settings
24
  article_kr = "μœ μ—”μ˜ λŒ€ν‘œλŠ” μ‹œλ¦¬μ•„μ— ꡰ사적인 해결책이 μ—†λ‹€κ³  λ§ν•©λ‹ˆλ‹€." #example article
25