mecoffey commited on
Commit
d3f19b1
·
1 Parent(s): bf5afa9

fixed intern error using brackets instead of parenthesis

Browse files
Files changed (1) hide show
  1. app.py +23 -23
app.py CHANGED
@@ -39,36 +39,36 @@ ick_traits = ''
39
  def char_description(prompt):
40
 
41
  prompt1 = f"{DESC_SYSTEM_PROMPT}\n\nCharacter Description: {prompt}\n\nDescribe:"
42
- output1 = pipe(prompt1, return_full_text=False)
43
  prompt2 = f"{BACK_SYSTEM_PROMPT}\n\n{output1}\n\nUser prompt: {prompt}\n\nDescribe:"
44
- output2 = pipe(prompt2, return_full_text=False)
45
  global strength
46
- strength = random.randint[2,12]
47
  global dexterity
48
- dexterity = random.randint[2,12]
49
  global constitution
50
- constitution = random.randint[2,12]
51
  global intelligence
52
- intelligence = random.randint[2,12]
53
  global wisdom
54
- wisdom = random.randint[2,12]
55
  global charisma
56
- charisma = random.randint[2,12]
57
  global ac
58
- ac = random.randint[2,14]
59
  global hp
60
- hp = constitution + random.randint[1,6]
61
  global smash
62
- smash = random.randint[1,30]
63
  input_file = open('traits.txt', 'r')
64
  traits = input_file.readline()
65
  global pref_traits
66
- picks = random.randint[1,3]
67
  pref_traits = random.choice(traits, k=picks)
68
  global ick_traits
69
- picks = random.randint[1,3]
70
  ick_traits = random.choice(traits, k=picks)
71
- return output1[0]["generated_text"].strip(),output2[0]["generated_text"].strip()
72
 
73
  @spaces.GPU
74
  def rand_char_description():
@@ -76,22 +76,22 @@ def rand_char_description():
76
  races = input_file.readline()
77
  rand_race = random.choice(races)
78
  prompt1 = f"{DESC_SYSTEM_PROMPT}\n\nCharacter Description: {rand_race}\n\nDescribe:"
79
- output1 = pipe(prompt1, return_full_text=False)
80
  prompt2 = f"{BACK_SYSTEM_PROMPT}\n\n{output1}\n\nUser prompt: {rand_race}\n\nDescribe:"
81
- output2 = pipe(prompt2, return_full_text=False)
82
  global strength
83
- strength = random.randint[2,12]
84
  global dexterity
85
- dexterity = random.randint[2,12]
86
  global constitution
87
- constitution = random.randint[2,12]
88
  global intelligence
89
- intelligence = random.randint[2,12]
90
  global wisdom
91
- wisdom = random.randint[2,12]
92
  global charisma
93
- charisma = random.randint[2,12]
94
- return output1[0]["generated_text"].strip(),output2[0]["generated_text"].strip()
95
 
96
  ##UI is fine as-is
97
  with gr.Blocks() as demo:
 
39
  def char_description(prompt):
40
 
41
  prompt1 = f"{DESC_SYSTEM_PROMPT}\n\nCharacter Description: {prompt}\n\nDescribe:"
42
+ output1 = pipe(prompt1)
43
  prompt2 = f"{BACK_SYSTEM_PROMPT}\n\n{output1}\n\nUser prompt: {prompt}\n\nDescribe:"
44
+ output2 = pipe(prompt2)
45
  global strength
46
+ strength = random.randint(2,12)
47
  global dexterity
48
+ dexterity = random.randint(2,12)
49
  global constitution
50
+ constitution = random.randint(2,12)
51
  global intelligence
52
+ intelligence = random.randint(2,12)
53
  global wisdom
54
+ wisdom = random.randint(2,12)
55
  global charisma
56
+ charisma = random.randint(2,12)
57
  global ac
58
+ ac = random.randint(2,14)
59
  global hp
60
+ hp = constitution + random.randint(1,6)
61
  global smash
62
+ smash = random.randint(1,30)
63
  input_file = open('traits.txt', 'r')
64
  traits = input_file.readline()
65
  global pref_traits
66
+ picks = random.randint(1,3)
67
  pref_traits = random.choice(traits, k=picks)
68
  global ick_traits
69
+ picks = random.randint(1,3)
70
  ick_traits = random.choice(traits, k=picks)
71
+ return output1,output2
72
 
73
  @spaces.GPU
74
  def rand_char_description():
 
76
  races = input_file.readline()
77
  rand_race = random.choice(races)
78
  prompt1 = f"{DESC_SYSTEM_PROMPT}\n\nCharacter Description: {rand_race}\n\nDescribe:"
79
+ output1 = pipe(prompt1)
80
  prompt2 = f"{BACK_SYSTEM_PROMPT}\n\n{output1}\n\nUser prompt: {rand_race}\n\nDescribe:"
81
+ output2 = pipe(prompt2)
82
  global strength
83
+ strength = random.randint(2,12)
84
  global dexterity
85
+ dexterity = random.randint(2,12)
86
  global constitution
87
+ constitution = random.randint(2,12)
88
  global intelligence
89
+ intelligence = random.randint(2,12)
90
  global wisdom
91
+ wisdom = random.randint(2,12)
92
  global charisma
93
+ charisma = random.randint(2,12)
94
+ return output1,output2
95
 
96
  ##UI is fine as-is
97
  with gr.Blocks() as demo: