diff --git a/pymatgen/io/core.py b/pymatgen/io/core.py
index <HASH>..<HASH> 100644
--- a/pymatgen/io/core.py
+++ b/pymatgen/io/core.py
@@ -46,9 +46,9 @@ class InputFile(MSONable):
         with open(filename, "wt") as f:
             f.write(self.__str__())
 
-    @staticmethod
+    @classmethod
     @abc.abstractmethod
-    def from_string(contents):
+    def from_string(cls, contents: str):
         """
         Create an InputFile object from a string
InputFile: from_string as classmethod