Spaces:
Paused
Paused
Update app_gr.py
Browse files
app_gr.py
CHANGED
@@ -110,7 +110,25 @@ async def setup():
|
|
110 |
|
111 |
if __name__ == "__main__":
|
112 |
asyncio.run(setup())'''
|
113 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
114 |
import sys
|
115 |
import asyncio
|
116 |
from aiohttp import web, WSMsgType
|
|
|
110 |
|
111 |
if __name__ == "__main__":
|
112 |
asyncio.run(setup())'''
|
113 |
+
|
114 |
+
file_path = "/home/user/.pyenv/versions/3.10.16/lib/python3.10/site-packages/basicsr/data/degradations.py"
|
115 |
+
|
116 |
+
# Ler o conteúdo do arquivo
|
117 |
+
with open(file_path, "r") as file:
|
118 |
+
content = file.read()
|
119 |
+
|
120 |
+
# Substituir a linha desejada
|
121 |
+
new_content = content.replace(
|
122 |
+
"from torchvision.transforms.functional_tensor import rgb_to_grayscale",
|
123 |
+
"from torchvision.transforms.functional import rgb_to_grayscale"
|
124 |
+
)
|
125 |
+
|
126 |
+
# Salvar o conteúdo atualizado
|
127 |
+
with open(file_path, "w") as file:
|
128 |
+
file.write(new_content)
|
129 |
+
|
130 |
+
print("Substituição concluída!")
|
131 |
+
|
132 |
import sys
|
133 |
import asyncio
|
134 |
from aiohttp import web, WSMsgType
|