wongshennan commited on
Commit
8ae5b18
1 Parent(s): b69040a

fix improt sort

Browse files
Files changed (2) hide show
  1. .vscode/settings.json +5 -0
  2. app.py +6 -5
.vscode/settings.json ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ {
2
+ "python.analysis.extraPaths": [
3
+ "./clip-interrogator"
4
+ ]
5
+ }
app.py CHANGED
@@ -1,10 +1,7 @@
1
  import random
2
  import warnings
3
  from io import BytesIO
4
- from clip_interrogator import Interrogator, Config
5
  import torch
6
- import gradio as gr
7
- import clip
8
  import stability_sdk.interfaces.gooseai.generation.generation_pb2 as generation
9
  from stability_sdk import client
10
  from PIL import Image
@@ -14,6 +11,7 @@ import argparse
14
  import subprocess
15
  import sys
16
  import time
 
17
 
18
 
19
  def setup():
@@ -28,7 +26,6 @@ def setup():
28
  for cmd in install_cmds:
29
  print(subprocess.run(cmd, stdout=subprocess.PIPE).stdout.decode('utf-8'))
30
 
31
-
32
  setup()
33
 
34
  sys.path.append('src/blip')
@@ -36,8 +33,12 @@ sys.path.append('src/clip')
36
  sys.path.append('clip-interrogator')
37
 
38
 
39
- ci = Interrogator(Config())
 
 
 
40
 
 
41
 
42
  stability_api = client.StabilityInference(
43
  key=os.environ['STABILITY_KEY'],
 
1
  import random
2
  import warnings
3
  from io import BytesIO
 
4
  import torch
 
 
5
  import stability_sdk.interfaces.gooseai.generation.generation_pb2 as generation
6
  from stability_sdk import client
7
  from PIL import Image
 
11
  import subprocess
12
  import sys
13
  import time
14
+ import os
15
 
16
 
17
  def setup():
 
26
  for cmd in install_cmds:
27
  print(subprocess.run(cmd, stdout=subprocess.PIPE).stdout.decode('utf-8'))
28
 
 
29
  setup()
30
 
31
  sys.path.append('src/blip')
 
33
  sys.path.append('clip-interrogator')
34
 
35
 
36
+ import clip
37
+ import gradio as gr
38
+ import torch
39
+ from clip_interrogator import Interrogator, Config
40
 
41
+ ci = Interrogator(Config())
42
 
43
  stability_api = client.StabilityInference(
44
  key=os.environ['STABILITY_KEY'],